declare @iCount int
select @iSum = 0
select @iCount = 1
while @iCount <= 100
begin
select @iSum = @iSum + @iCount
select @iCount = @iCount + 1
end
#include<stdio.h>int main()
{
int i=0,sum=0
for(i=1i<=100i++)
{
sum+=i
}
printf("%d",sum)
return 0
}
#include<stdio.h>main()
{
int i=1,sum=0
for(i<=100i++)
sum+=i//累加
printf("%d\n",sum)//输出结果
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)