C:1到100的累加和;
#include <stdio.h>
int main(){
int i, s=0;
for(i=100;i>=0;i--){
s=s+1;
}
printf("s=%d",s);
return 0;
}
int main(){
int i=1,s=0;
do{
s+=i;
i++;
}while(i<=100);
printf("i=%dn",i);
printf("s=%dn",s);
return 0;
}