A+b for Input-output Practice (V)
Time limit:2000/1000 MS (java/others) Memory limit:65536/32768 K (java/others) total submission (s): 67443 Accepted Submission (s): 45101
Problem Descriptionyour task is to calculate the sum of some integers. Inputinput contains an integer n on the first line, and then n lines follow. Each line starts with an integer m, and then M integers follow in the same line. Outputfor each group of the input integers you should output their sum on one line, and with one line of output for each line In input. Sample Input24 1 2 3 1 2 3 4 5 Sample Output1015
1#include <iostream>2 using namespacestd;3 intMain () {4 intN;5 inttest;6CIN >>test;7 8 while(test--)9 {Ten intsum =0; OneCIN >>N; A inttemp; - for(inti =1; I <= N; i++) - { theCIN >>temp; -Sum + =temp; - } -cout << sum <<Endl; + } - + return 0; A}View Code
HDU 1093 A+b for Input-output practice (V)