首页 > 其他分享> > 求1+2+3+4+++++·····+n (while类型) 求1+2+3+4+++++·····+n (while类型) 2022-02-08 15:02:31 作者:互联网 #include<stdio.h> void main() { int i=1,sum=0,n; printf("input:n="); scanf("%d",&n); while(i<=n){ sum=sum+i; i++;} printf("%d\n",sum); } 标签:int,sum,while,+++++,printf,类型,include,void 来源: https://blog.csdn.net/NZZHAO/article/details/122823795