标签:sig inpu class 提交 output putchar follow scanf ott
#include <stdio.h> int sso(int n); int main(void) { int i; while (scanf_s("%d", &i) != EOF) { printf("%d\n",sso(i)); putchar(‘\n‘); } return 0; } int sso(int n) { int i, sum=0; for (i = 0; i <= n; i++) sum += i; return sum; }
第二次AC
#include <stdio.h> int main(void) { int a = 0, b, sum = 0; while (scanf_s("%d", &b) != EOF) { sum = 0, a = 0; do { a = a + 1; sum = a + sum; } while (a<b); printf("%d\n", sum); printf("\n"); } return 0; }
标签:sig inpu class 提交 output putchar follow scanf ott
原文地址:http://www.cnblogs.com/WLHBlog/p/7565262.html