#作业目标:要求用户输入两个数a、b,如果a被b整除或者a加b大于100,则输出a的值,否则输出b的值
##代码
Console.WriteLine("输入数字a");
string str_number1 = Console.ReadLine();
int a = Convert.ToInt32(str_number1);
Console.WriteLine("输入数字b");
string str_number2 = Console.ReadLine();
int b = Convert.ToInt32(str_number2);
if (a % b == 0 || a + b > 100)
{ Console.WriteLine("{0}",a);}
else{Console.WriteLine("{0}",b);}
Console.WriteLine("程序运行结束");
Console.ReadKey();
网友评论