#include<iostream.h>
void main()
{
int i=1,sum=0;
while(i<=100)
{
sum+=i;
i++;
}
cout<<"1到100的和是:"<<sum<<endl;
}
#include<iostream.h>
void main()
{
int i=1,sum=0;
while(i<=100)
{
sum+=i;
i++;
}
cout<<"1到100的和是:"<<sum<<endl;
}