首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

学校为省赛做准备 让每组出一道题 求 ACM 水题一道,该怎么处理

2012-05-20 
学校为省赛做准备让每组出一道题求 ACM 水题一道学校为省赛做准备让每组出一道题做个队内练习我们组出水题

学校为省赛做准备 让每组出一道题 求 ACM 水题一道
学校为省赛做准备 让每组出一道题 做个队内练习 我们组出水题.... 因此求水题一道。 



题目请附带数据、标程、解题报告。
排版如下:
Problem A. A + B Problem

Time Limit: 1000 MS Memory Limit: 65536 K
Description

Calculate a + b.
Input

There are multiple test cases. The first line of input is an integer T indicating the number of test cases. Then T test cases follow.
For each test case:
Line 1. This line contains two integers a, b (-1000?≤?a, b?≤?1000).
Output

For each test case:
Line 1. Output the sum of a and b.
Sample Input

2
1 2
2 3
Sample Output

3
5
Hint

G++ Source Code:
#include <iostream>
using namespace std;
int main() {
int f;
cin >> f;
while (f--) {
int a, b;
cin >> a >> b;
cout << a + b << endl;
}
return 0;
}
 
GCC Source Code:
#include <stdio.h>
int main(){
int f, a, b;
scanf("%d", &f);
while (f--) {
scanf("%d%d", &a, &b);
printf("%d\n", a + b);
}
return 0;
}
 
JAVA Source Code:
import java.io.*;
import java.util.*;
public class Main{
  public static void main(String args[]) throws Exception {
  Scanner cin=new Scanner(System.in);
  int f;
  f = cin.nextInt();
  while ((f--) > 0) {
  int a, b;
  a = cin.nextInt();
  b = cin.nextInt();
  System.out.println(a + b);
  }
  }
}
Author

xxxx


[解决办法]
http://blog.csdn.net/kingwolfofsky/article/details/6183319
有题目有数据,总有个适合你
[解决办法]
楼主到杭电上去看看吧,水题多了去了。随便挑啊。
http://acm.hdu.edu.cn/listproblem.php?vol=1

热点排行