using System;
using System.Threading;
namespace HelloWorldApplication
{
class HelloWorld
{
static void Main(string[] args)
{
int a;
int b;
int c;
int x;
Random rand2 = new Random();
x=rand2.Next(-1,2);
if(x>=0)
{
do
{
a=rand2.Next(20);
b=rand2.Next(20);
c=a-b;
}while(c<0);
Console.WriteLine("减法:{0}-{1}={2}",a,b,c);
}
else
{
a=rand2.Next(20);
b=rand2.Next(20);
c=a+b;
Console.WriteLine("加法:{0}+{1}={2}",a,b,c);
}
Console.ReadKey(true);
}
}
}