View Code of Problem 1

#include<stdio.h>
int main()
{
    int a,b;
    while(scanf("%d %d",&a,&b)!=EOF)
    {
        //EOF代表文件结尾,测试时通过文件输入数据
        //当输入到文件尾部时停止处理
        //当在控制台输入时按Ctrl+Z代表文件末尾
        printf("%d\n",a+b);
    }
    return 0;
}

Double click to view unformatted code.


Back to problem 1