int count = 0;
for(int i=1;i<=100;i++)
{
count = count + i;
}
上面写的明白了把!
using System;
namespace ConsoleApplication3
{
class Program
{
static void Main()
{
int num = 0;
for (int i = 1; i <= 100; i++)
{
num += i;
}
Console.WriteLine(num);
}
}
}
int count = 0;
for(int i=1;i<=100;i++)
{
count = count + i;
}
Response.Write(count.ToString());
using System;
class lyf;
{
int i,sum=0;
for(i=1;i<100;i++)
{
sum+=i;
}
Console.WriteLine("1到一百的和是{0}",sum);
}
太菜了吧
int count = 0;
for(int i=1;i<=100;i++)
{
count = count + i;
}
Response.Write(count.ToString());