hd-1093:A+B for Input-Output Practice (V)
来源:互联网 发布:java验证码代码怎么写 编辑:程序博客网 时间:2024/06/11 01:39
Problem Description
Your task is to calculate the sum of some integers.
Input
Input contains an integer N in the first line, and then N lines follow. Each line starts with a integer M, and then M integers follow in the same line.
Output
For each group of input integers you should output their sum in one line, and with one line of output for each line in input.
Sample Input
24 1 2 3 45 1 2 3 4 5
Sample Output
1015#include <stdio.h>int main(){ int n,i,m,j,a[1000],sum; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%d",&m); for(j=0;j<m;j++) scanf("%d",&a[j]); for(j=0,sum=0;j<m;j++) sum+=a[j]; printf("%d\n",sum); } return 0;}
0 0
- hd-1093:A+B for Input-Output Practice (V)
- 1408181859-hd-A+B for Input-Output Practice (V).cpp
- A+B for Input-Output Practice (V)
- A+B for Input-Output Practice (V)
- A+B for Input-Output Practice (V)
- A+B for Input-Output Practice (V)
- A+B for Input-Output Practice (V)
- A+B for Input-Output Practice (V)
- A+B for Input-Output Practice (V)
- A+B for Input-Output Practice (V)
- A+B for Input-Output Practice (V)
- A+B for Input-Output Practice (V)
- A+B for Input-Output Practice (V)
- A+B for Input-Output Practice (V)
- A+B for Input-Output Practice (V)
- 1093 A+B for Input-Output Practice (V)
- HDOJ 1093: A+B for Input-Output Practice (V)
- 1093 A+B for Input-Output Practice (V)
- 大数据处理分析的工具介绍
- 阿里巴巴装袋问题
- Java NIO 特性学习
- 基于CentOS的Mysql学习补充二--使用Shell创建数据库
- POJ-3006 Dirichlet's Theorem on Arithmetic Progressions
- hd-1093:A+B for Input-Output Practice (V)
- Spark: sortBy和sortByKey函数详解
- mybatis 的mapper代理小结
- Search in Rotated Sorted Array
- php学习笔记
- 【iOS开发】企业版证书($299)In-House方式发布指南
- [DLX重复覆盖] hdu 2828 Lamp
- Java 通过JDBC连接Mysql数据库的方法和实例(改动版)
- 【UIKit】-5,6,7-UIActivity - 系统服务,社交信息等