HDU 1093 A+b for Input-output practice (V)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.