Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions blackboy19991/周成杰/周成杰.sln
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions blackboy19991/周成杰/周成杰/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
</configuration>
125 changes: 125 additions & 0 deletions blackboy19991/周成杰/周成杰/Program.cs
Original file line number Diff line number Diff line change
@@ -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();
}
}
}
36 changes: 36 additions & 0 deletions blackboy19991/周成杰/周成杰/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -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")]
53 changes: 53 additions & 0 deletions blackboy19991/周成杰/周成杰/周成杰.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{6320CB17-677F-42FB-82E2-9406240B93A0}</ProjectGuid>
<OutputType>Exe</OutputType>
<RootNamespace>周成杰</RootNamespace>
<AssemblyName>周成杰</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
32 changes: 32 additions & 0 deletions blackboy19991/周成杰/周成杰Tests/ProblemTests.cs
Original file line number Diff line number Diff line change
@@ -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();
}
}
}
36 changes: 36 additions & 0 deletions blackboy19991/周成杰/周成杰Tests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -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")]
5 changes: 5 additions & 0 deletions blackboy19991/周成杰/周成杰Tests/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MSTest.TestAdapter" version="1.3.2" targetFramework="net461" />
<package id="MSTest.TestFramework" version="1.3.2" targetFramework="net461" />
</packages>
Loading