HDU 1096
来源:互联网 发布:网络舆情监测专业 编辑:程序博客网 时间:2024/06/04 20:07
A+B for Input-Output Practice (VIII)
Problem DescriptionYour 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.
还是累加,只不过输出是每个之间输出一个空行,最后一个数据后面没有空行。
#include<stdio.h>int main (){ int s[100],i,n,sum,t,j,u; while (scanf ("%d",&t)!=EOF) { for(j=0;j<t;j++) { scanf ("%d",&n); sum=0; for (i=0;i<n;i++) { scanf("%d",&u); sum=sum+u; } s[j]=sum; } for (j=0;j<t;j++) { if(j==t-1) printf ("%d\n",s[j]); else printf ("%d\n\n",s[j]); } } return 0;}
1 0
- hdu 1096
- hdu 1096
- hdu 1096
- HDU-1096
- HDU-1096
- HDU 1096
- HDU 1096
- HDU 1096 A+B
- HDU 1096(水题)
- HDU 1091-1096
- HDU 1096 JAVA
- hdu
- hdu
- HDU
- hdu ()
- hdu
- hdu
- HDU
- Java中HashMap详解
- java叮咚云短信验证码接口调用
- 如何从Google Play下载应用到电脑
- CSS子选择符
- OC/Swift 根据label字数字体返回实际高度
- HDU 1096
- mysql字段类型选择时float和decimal如何选择
- men
- SAP错误问题汇总
- ExtJS-bootstrap.js的工作方式
- jstree使用【一】初次使用
- 五、数据结构与算法--栈及队列
- Android App罕见错误和优化方案
- Studio android 快捷键文档