using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication3
{
class Program
{
static void Main(string[] args)
{
int n = 0, sum=1;
do
{
sum += n;
n++;
} while (n <= 100);
Console.WriteLine("n:{0}自然数之和为:{1}", n,sum);
Console.Read();
}
}
}
自然数之和
最新推荐文章于 2024-08-25 21:47:46 发布