using System;
using System.Collections.Generic;
using System.Text;
namespace 判断对错
{
class Program
{
static void Main(string[] args)
{
int sum1=0;
int sum = 0, cha = 0, ji = 0, yu = 0;
x:
{
Console.Write("请输入一个整数:");
int i = int.Parse(Console.ReadLine());
Console.Write("请再输入一个整数:");
int j = int.Parse(Console.ReadLine());
Console.WriteLine("请输入你想求什么值(+,-,*,/)");
char op = char.Parse(Console.ReadLine());
Console.Write("{0}{1}{2}"+"=",i,op,j);
int s =int.Parse(Console.ReadLine());
switch(op)
{
case '+':
sum=i+j;
break;
case '-':
cha=i-j;
break;
case'*':
ji=i*j;
break;
case'/':
yu=i/j;
break;
}
if(s==sum||s==cha||s==ji||s==yu)
{
Console.WriteLine("答案正确!!");
sum1++;
}
}
Console.WriteLine("你想继续答题?(y/n)");
char op1 = Char.Parse(Console.ReadLine());
if (op1 == 'y' || op1 == 'Y')
{
goto x;
}
Console.WriteLine("答对的题目数为{0}",sum1);
Console.ReadLine();
}
}
}