HDU1096:A+B for Input-Output Practice (VIII)

标签: ACM HDU
1人阅读 评论(0) 收藏 举报
分类:


/*
与1093的区别是每行结果后多个空行,最后行输入后没有空行
*/

#include <stdio.h>

int main()
{
	int caseNum;
	int N;
	int i, j, a;
	int sum;

	//freopen("F:\\input.txt", "r", stdin);
	scanf("%d", &caseNum);
	for (i = 0; i < caseNum; i++)
	{
		scanf("%d", &N);
		sum = 0;
		for (j = 0; j < N; j++)
		{
			scanf("%d", &a);
			sum += a;
		}
		printf("%d\n", sum);
		if (i != caseNum - 1)
			printf("\n");
	}
	//freopen("con", "r", stdin);
	//system("pause");
	return 0;
}

查看评论

1096:A+B for Input-Output Practice (VIII)

这个是格式控制问题。
  • BeiZhang1991
  • BeiZhang1991
  • 2014-04-11 17:42:02
  • 2335

HDU-1096-A+B for Input-Output Practice (VIII)(最后一行不输出空格)

A+B for Input-Output Practice (VIII) Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/...
  • qq_16542775
  • qq_16542775
  • 2015-07-15 15:09:28
  • 1242

[水题][hdoj_1096]A+B for Input-Output Practice (VIII)

// hdoj_1096 A+B for Input-Output Practice (VIII) #include int main(void) { int n, m, a, sum, i, ...
  • litiouslove
  • litiouslove
  • 2012-07-31 01:42:21
  • 3454

杭电acm1096A+B for Input-Output Practice (VIII)

A+B for Input-Output Practice (VIII) Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/...
  • fingersorry
  • fingersorry
  • 2014-09-16 19:05:33
  • 327

[水题][hdoj_1094]A+B for Input-Output Practice (VI)

// hdoj_1094 A+B for Input-Output Practice (VI) #include int main(void) { int n, a, sum, i; whil...
  • litiouslove
  • litiouslove
  • 2012-07-31 01:20:16
  • 2461

【杭电】[1094]A+B for Input-Output Practice (VI)

输入输出训练
  • u011493189
  • u011493189
  • 2015-12-20 11:05:47
  • 459

「HD_ACM」A+B for Input-Output Practice (VII)

Problem Description Your task is to Calculate a + b. ->你的任务是计算A + B   Input T...
  • Simple_Bottle
  • Simple_Bottle
  • 2015-05-02 21:59:50
  • 1838

HDU1096 A+B for Input-Output Practice (VIII)

Problem Description Your task is to calculate the sum of some integers. Input Input contains an ...
  • qrzbing
  • qrzbing
  • 2017-02-02 16:58:29
  • 73

「HD_ACM」 A+B for Input-Output Practice (II)

Problem Description Your task is to Calculate a + b. ->你的任务是计算A + B   Input I...
  • Simple_Bottle
  • Simple_Bottle
  • 2015-05-01 22:41:45
  • 1704

山东理工大学ACM平台题答案关于C语言 1012 A+B for Input-Output Practice (III)

A+B for Input-Output Practice (III) Time Limit: 1000ms   Memory limit: 65536K  有疑问?点这里^_^ 题目...
  • u012707729
  • u012707729
  • 2013-12-13 20:56:31
  • 1030
    个人资料
    等级:
    访问量: 1万+
    积分: 374
    排名: 20万+
    文章存档
    最新评论