RISEBY
So easy!- -@C语言->[for]main(){int a,x,y,s=0;scanf("%d%d",&x,&y);for(a=0;a<=y;a++)s+=x+a;printf("sum=%d",s);}->[while]main(){int a=0,x,y,s=0;scanf("%d%d",&x,&y);while(a<=y)s+=x+a++;printf("sum=%d",s);}->[do-while]main(){int a=0,x,y,s=0;scanf("%d%d",&x,&y);do{s+=x+a;}while(++a<=y);printf("sum=%d",s);}可以在scanf后面加个if(y<0)算式非法的判断.初学不写没关系.上面3个我在TC2.0上调过了.没有问题.如果是C++的话,随便一改就可以啦.