Your task is to calculate the sum of some integers输入Input contains multiple test cases and one case one line Each case starts with an integer N and then N integers follow in the same line输出For each te
#include <stdio.h>
int main(){ int n, num, sum; while(scanf("%d", &n) != EOF){ sum = 0; for(int i = 0; i < n; i++){ scanf("%d", &num); sum += num; } printf("%d\n", sum); } return 0; }
原文地址: http://www.cveoy.top/t/topic/hjIi 著作权归作者所有。请勿转载和采集!