diff --git "a/blackboy19991/\345\221\250\346\210\220\346\235\260/\345\221\250\346\210\220\346\235\260.sln" "b/blackboy19991/\345\221\250\346\210\220\346\235\260/\345\221\250\346\210\220\346\235\260.sln" new file mode 100644 index 0000000..049e2bf --- /dev/null +++ "b/blackboy19991/\345\221\250\346\210\220\346\235\260/\345\221\250\346\210\220\346\235\260.sln" @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.852 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "周成杰", "周成杰\周成杰.csproj", "{6320CB17-677F-42FB-82E2-9406240B93A0}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "周成杰Tests", "周成杰Tests\周成杰Tests.csproj", "{394E10D6-89FF-40EE-8236-951617B03F52}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {6320CB17-677F-42FB-82E2-9406240B93A0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6320CB17-677F-42FB-82E2-9406240B93A0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6320CB17-677F-42FB-82E2-9406240B93A0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6320CB17-677F-42FB-82E2-9406240B93A0}.Release|Any CPU.Build.0 = Release|Any CPU + {394E10D6-89FF-40EE-8236-951617B03F52}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {394E10D6-89FF-40EE-8236-951617B03F52}.Debug|Any CPU.Build.0 = Debug|Any CPU + {394E10D6-89FF-40EE-8236-951617B03F52}.Release|Any CPU.ActiveCfg = Release|Any CPU + {394E10D6-89FF-40EE-8236-951617B03F52}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {5BF2E059-CA5C-49D2-89EF-04EAA32C5182} + EndGlobalSection +EndGlobal diff --git "a/blackboy19991/\345\221\250\346\210\220\346\235\260/\345\221\250\346\210\220\346\235\260/App.config" "b/blackboy19991/\345\221\250\346\210\220\346\235\260/\345\221\250\346\210\220\346\235\260/App.config" new file mode 100644 index 0000000..731f6de --- /dev/null +++ "b/blackboy19991/\345\221\250\346\210\220\346\235\260/\345\221\250\346\210\220\346\235\260/App.config" @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git "a/blackboy19991/\345\221\250\346\210\220\346\235\260/\345\221\250\346\210\220\346\235\260/Program.cs" "b/blackboy19991/\345\221\250\346\210\220\346\235\260/\345\221\250\346\210\220\346\235\260/Program.cs" new file mode 100644 index 0000000..390f2ad --- /dev/null +++ "b/blackboy19991/\345\221\250\346\210\220\346\235\260/\345\221\250\346\210\220\346\235\260/Program.cs" @@ -0,0 +1,125 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.IO; + +namespace 周成杰 +{ + + public class Problem + { + public int a, b, c, d, n, sum; + char[] s = { '+', '-', '*', '/' }; + public Problem(int n) + { + + } + public void Print() + { + Random random = new Random(); + Console.WriteLine("请输入四则运算题目个数:"); + n = int.Parse(Console.ReadLine()); + for (int i = 0; i < n; i++) + { + + // char s1 = s[t]; + int t = random.Next(1, 9); + //char s2 = s[t]; + a = random.Next(1, 100); //生成1-100之间的随机数 + b = random.Next(1, 100); + c = random.Next(1, 100); + d = random.Next(1, 100); + if (t == 1) + { + sum = a + b + c; + Console.WriteLine(a + "+" + b + "+" + c + "=" + sum); + } + else if (t == 2) + { + c = random.Next(1, a + b); + for (; a + b - c < 0;) + c = random.Next(1, a + b); + sum = a + b - c; + Console.WriteLine(a + "+" + b + "-" + c + "=" + sum); + } + else if (t == 3) + { + sum = a + b * c; + Console.WriteLine(a + "+" + b + "*" + c + "=" + sum); + } + else if (t == 4) + { + + for (; b % c != 0; c = random.Next(1, b)) + c = random.Next(2, b); + sum = a + b / c; + Console.WriteLine(a + "+" + b + "/" + c + "=" + sum); + } + else if (t == 5) + { + + for (; b % c != 0;) + c = random.Next(2, b); + sum = a * d + b / c; + Console.WriteLine(a + "*" + d + "+" + b + "/" + c + "=" + sum); + } + else if (t == 6) + { + + for (; b % c != 0; c = random.Next(1, b)) + + d = random.Next(2, a); + sum = a + b / c - d; + Console.WriteLine(a + "+" + b + "/" + c + "-" + d + "=" + sum); + + } + else if (t == 7) + { + + for (; b % c != 0;) + c = random.Next(1, b); + sum = a + b / c * d; + Console.WriteLine(a + "+" + b + "/" + c + "*" + d + "=" + sum); + } + else if (t == 8) + { + + + sum = a * b + c * d; + Console.WriteLine(a + "*" + b + "+" + c + "*" + d + "=" + sum); + } + else if (t == 9) + { + + for (; c % d != 0;) + d = random.Next(1, c); + sum = a * b + c / d; + Console.WriteLine(a + "*" + b + "+" + c + "/" + d + "=" + sum); + } + + } + + + } + public void Writew() + { + string fileName = @"F:\\Temp.txt"; + StreamWriter sa = new StreamWriter(fileName); + sa.WriteLine(); + sa.Flush(); + } + + } + class Program + { + + static void Main(string[] args) + { + Problem v = new Problem(1); + v.Print(); + Console.Read(); + } + } +} \ No newline at end of file diff --git "a/blackboy19991/\345\221\250\346\210\220\346\235\260/\345\221\250\346\210\220\346\235\260/Properties/AssemblyInfo.cs" "b/blackboy19991/\345\221\250\346\210\220\346\235\260/\345\221\250\346\210\220\346\235\260/Properties/AssemblyInfo.cs" new file mode 100644 index 0000000..c93b9d5 --- /dev/null +++ "b/blackboy19991/\345\221\250\346\210\220\346\235\260/\345\221\250\346\210\220\346\235\260/Properties/AssemblyInfo.cs" @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的一般信息由以下 +// 控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("周成杰")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("周成杰")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// 将 ComVisible 设置为 false 会使此程序集中的类型 +//对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 +//请将此类型的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("6320cb17-677f-42fb-82e2-9406240b93a0")] + +// 程序集的版本信息由下列四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号 +// 方法是按如下所示使用“*”: : +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git "a/blackboy19991/\345\221\250\346\210\220\346\235\260/\345\221\250\346\210\220\346\235\260/\345\221\250\346\210\220\346\235\260.csproj" "b/blackboy19991/\345\221\250\346\210\220\346\235\260/\345\221\250\346\210\220\346\235\260/\345\221\250\346\210\220\346\235\260.csproj" new file mode 100644 index 0000000..a74c971 --- /dev/null +++ "b/blackboy19991/\345\221\250\346\210\220\346\235\260/\345\221\250\346\210\220\346\235\260/\345\221\250\346\210\220\346\235\260.csproj" @@ -0,0 +1,53 @@ + + + + + Debug + AnyCPU + {6320CB17-677F-42FB-82E2-9406240B93A0} + Exe + 周成杰 + 周成杰 + v4.6.1 + 512 + true + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git "a/blackboy19991/\345\221\250\346\210\220\346\235\260/\345\221\250\346\210\220\346\235\260Tests/ProblemTests.cs" "b/blackboy19991/\345\221\250\346\210\220\346\235\260/\345\221\250\346\210\220\346\235\260Tests/ProblemTests.cs" new file mode 100644 index 0000000..e14ef3c --- /dev/null +++ "b/blackboy19991/\345\221\250\346\210\220\346\235\260/\345\221\250\346\210\220\346\235\260Tests/ProblemTests.cs" @@ -0,0 +1,32 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using 周成杰; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace 周成杰.Tests +{ + [TestClass()] + public class ProblemTests + { + [TestMethod()] + public void ProblemTest() + { + Assert.Fail(); + } + + [TestMethod()] + public void PrintTest() + { + Assert.Fail(); + } + + [TestMethod()] + public void WritewTest() + { + Assert.Fail(); + } + } +} \ No newline at end of file diff --git "a/blackboy19991/\345\221\250\346\210\220\346\235\260/\345\221\250\346\210\220\346\235\260Tests/Properties/AssemblyInfo.cs" "b/blackboy19991/\345\221\250\346\210\220\346\235\260/\345\221\250\346\210\220\346\235\260Tests/Properties/AssemblyInfo.cs" new file mode 100644 index 0000000..f42395a --- /dev/null +++ "b/blackboy19991/\345\221\250\346\210\220\346\235\260/\345\221\250\346\210\220\346\235\260Tests/Properties/AssemblyInfo.cs" @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// 有关程序集的一般信息由以下 +// 控制。更改这些特性值可修改 +// 与程序集关联的信息。 +[assembly: AssemblyTitle("周成杰Tests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("周成杰Tests")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +//将 ComVisible 设置为 false 将使此程序集中的类型 +//对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, +//请将此类型的 ComVisible 特性设置为 true。 +[assembly: ComVisible(false)] + +// 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID +[assembly: Guid("394e10d6-89ff-40ee-8236-951617b03f52")] + +// 程序集的版本信息由下列四个值组成: +// +// 主版本 +// 次版本 +// 生成号 +// 修订号 +// +//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值, +// 方法是按如下所示使用“*”: : +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git "a/blackboy19991/\345\221\250\346\210\220\346\235\260/\345\221\250\346\210\220\346\235\260Tests/packages.config" "b/blackboy19991/\345\221\250\346\210\220\346\235\260/\345\221\250\346\210\220\346\235\260Tests/packages.config" new file mode 100644 index 0000000..102a45c --- /dev/null +++ "b/blackboy19991/\345\221\250\346\210\220\346\235\260/\345\221\250\346\210\220\346\235\260Tests/packages.config" @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git "a/blackboy19991/\345\221\250\346\210\220\346\235\260/\345\221\250\346\210\220\346\235\260Tests/\345\221\250\346\210\220\346\235\260Tests.csproj" "b/blackboy19991/\345\221\250\346\210\220\346\235\260/\345\221\250\346\210\220\346\235\260Tests/\345\221\250\346\210\220\346\235\260Tests.csproj" new file mode 100644 index 0000000..03aea50 --- /dev/null +++ "b/blackboy19991/\345\221\250\346\210\220\346\235\260/\345\221\250\346\210\220\346\235\260Tests/\345\221\250\346\210\220\346\235\260Tests.csproj" @@ -0,0 +1,106 @@ + + + + + Debug + AnyCPU + {394E10D6-89FF-40EE-8236-951617B03F52} + Library + Properties + 周成杰Tests + 周成杰Tests + v4.6.1 + 512 + {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages + False + UnitTest + + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\MSTest.TestFramework.1.3.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll + + + ..\packages\MSTest.TestFramework.1.3.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll + + + + + + + + + + + + + + + + + + + + + {6320CB17-677F-42FB-82E2-9406240B93A0} + 周成杰 + + + + + + + False + + + False + + + False + + + False + + + + + + + + + 这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。 + + + + + + + \ No newline at end of file