代碼int mun = 0;
Console.WriteLine("請(qǐng)輸入一個(gè)數(shù)字");
string str_mun = Console.ReadLine();
try
{
mun = Convert.ToInt32(str_mun);
}
catch
{
Console.WriteLine("你輸入有錯(cuò)誤");
}
for (int i = 0; i <= mun; i++)
{
Console.WriteLine("{0}+{1}={2}",i,mun-i,mun);
}
Console.ReadKey();