#作業(yè)要求
要求用戶輸入兩個(gè)數(shù)a微渠、b,如果a被b整除或者a加b大于100盏浇,則輸出a的值匠璧,否則輸出b的值
#程序
namespace ConsoleApplication1
{
? ? class Program
? ? {
? ? ? ? static void Main(string[] args)
? ? ? ? {
? ? ? ? ? ? Console.WriteLine("請輸入數(shù)a");
? ? ? ? ? ? int a = Convert.ToInt32(Console.ReadLine());
? ? ? ? ? ? Console.WriteLine("請輸入數(shù)b");
? ? ? ? ? ? int b = Convert.ToInt32(Console.ReadLine());
? ? ? ? ? ? if (a % b == 0 || a + b > 100)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? Console.WriteLine(a);
? ? ? ? ? ? }
? ? ? ? ? ? else
? ? ? ? ? ? {
? ? ? ? ? ? ? ? Console.WriteLine(b);
? ? ? ? ? ? }
? ? ? ? ? ?
? ? ? ? ? ? Console.ReadKey();
? ? ? ? }
? ? }
}
#效果
圖片發(fā)自簡書App