1000.cpp

来自「杭电 acm部分代码 有兴趣的可以下载 谢谢」· C++ 代码 · 共 25 行

CPP
25
字号
//Calculate a + b 
//Input
//The input will consist of a series of pairs of integers a and b,separated by a space, one pair of integers per line. 
//Output
//For each pair of input integers a and b you should output the sum of a and b in one line,and with one line of output for each line in input.
//Sample Input
//1 5
//Sample Output
//6
//Hint

#include<stdio.h>

void main()
{
	int input1,input2;
	
	while(scanf("%d %d",&input1,&input2)!=EOF)
		printf("%d\n",input1+input2);
}


//总结:scanf函数的返回值等于其输入的参数个数
//若输入的参数个数为0,则其返回值为EOF。

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?