1 / 10
文档名称:

ACM+输入输出入门.doc

格式:doc   页数:10页
下载后只包含 1 个 DOC 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

ACM+输入输出入门.doc

上传人:875845154 2016/4/13 文件大小:0 KB

下载得到文件列表

ACM+输入输出入门.doc

文档介绍

文档介绍:HDOJ1089 输入格式:有多个 case 输入,直到文件结束输出格式:一行一个结果 Problem Description Your task is to Calculate a+ b. Too easy?! Of course! I specially designed the problem for acm beginners. You must have found that some problems have the same titles with this one, yes, all these problems were designed for the same aim. Input The input will consist ofa series of pairs of integers a and b, separated bya space, one pair of integers per line. Output For each pair of input integers a and b you should output the sum ofa and b in one line, and with one line of output for each line in input. Sample Input 15 10 20 Sample Output 6 30 Author lcy mend JGShining #include <> int main() { int a,b; while( scanf( "%d%d" , &a , &b ) != EOF ) // 输入直到文件结尾{ printf( "%d\n" , a+b ); // 一行一个结果} return 0; } HDOJ1090 输入格式:先输入有 case 数,再依次输入每个 case 输出格式:一行一个结果#include <> Problem Description Your task is to Calculate a+ b. Input Input contains an integer N in the first line, and then N lines follow. Each line consists ofa pair of integers a and b, separated bya space, one pair of integers per line. Output For each pair of input integers a and b you should output the sum ofa and b in one line, and with one line of output for each line in input. Sample Input 215 10 20 Sample Output 6 30 Author lcy mend JGShining int main() { int n,a,b; scanf( "%d" , &n ); // 输入的 case 数 while( n-- ) // 控制输入{ scanf( "%d%d" , &a , &b