求一系列整数的和.txt
来自「最常用的50个经典程序」· 文本 代码 · 共 25 行
TXT
25 行
using System;
using System.Threading;
class My302
{
static void Main()
{
Console.WriteLine("Please Input the Number:");
int all = int.Parse(Console.ReadLine());
int sum=0,temp=0;
for (int i=1;i<=all;i++)
{
Console.Write("Please Input the NO."+i+" value:");
temp=int.Parse(Console.ReadLine());
sum+=temp;
}
Thread.Sleep(1000);
Console.WriteLine("The all is "+sum);
Thread.Sleep(5000);
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?