最近在尝试做acm试题,刚刚是1001题就把我困住了,这是题目: Problem Description In this problem, your task is to calculate SUM(n) = 1 + 2 + 3 + ... + n. Input The input will consist of a series of integers n, one integer per line Output For each case, output SUM(n) in one…
#include <stdio.h> #include <algorithm> using namespace std; int main () { int a[110],b[110],c[110]; int m,n; int i,j,k; int flag; scanf("%d%d",&m,&n); while (m!=0||n!=0) { k = 0; flag = 0; for (i=0;i<m;i++) scanf("%d…