源代码:
#include <stdio.h> int main() { int n, sum; scanf("%d",&n); sum=n*(n+1)/2; printf("sum = %d\n", sum); return 0; }
图片:
结论:写法1与写法2可以满足要求
标签:task2,源代码,int,sum,main,写法 From: https://www.cnblogs.com/zzaw/p/17181733.html
源代码:
#include <stdio.h> int main() { int n, sum; scanf("%d",&n); sum=n*(n+1)/2; printf("sum = %d\n", sum); return 0; }
图片:
结论:写法1与写法2可以满足要求
标签:task2,源代码,int,sum,main,写法 From: https://www.cnblogs.com/zzaw/p/17181733.html