A+B Problem
Time Limit: 1000MS   Memory Limit: 10000K
Total Submissions: 311263   Accepted: 171333

Description

Calculate a+b

Input

Two integer a,b (0<=a,b<=10)

Output

Output a+b
 

Sample Input

1 2

Sample Output

3

计算两个整数的和

解决思路

这是经典水题了,每个OJ必有的。
题目很简单,就是对输入的两个整数a和b,输出它们的和。

用C++的基本语法就能搞定。

C++:
 /*
poj 1000
version:1.0
author:Knight
Email:S.Knight.Work@gmail.com
  website:www.getyourwant.com
*/ #include<cstdio>
using namespace std; int main()
{
int a,b;
scanf("%d%d", &a, &b);
printf("%d\n", a + b);
return ;
}
JAVA:
 import java.io.*;
import java.util.*; public class Main {
public static void main(String[] args) {
Scanner cinScanner = new Scanner(System.in);
int a = cinScanner.nextInt();
int b = cinScanner.nextInt(); System.out.println(a + b);
}
}

 

[POJ 1000] A+B Problem 经典水题 C++解题报告 JAVA解题报告的更多相关文章

  1. fzuoj Problem 2182 水题

    http://acm.fzu.edu.cn/problem.php?pid=2182 Problem 2182 水题 Accept: 188    Submit: 277Time Limit: 100 ...

  2. 【UVA - 1644 / POJ - 3518】Prime Gap(水题)

    Prime Gap 这里直接写中文了 Descriptions: 对于一个数n,若n为素数则输出0,否则找到距离n最小的两个素数,一个大于n,一个小于n,输出他们的差(正数) Input 多组输入 每 ...

  3. caioj 1000到1030都是[水题]

    caioj 1000到1030都是[水题],特此声明一下,可以不做就不要浪费时间做了

  4. 烟大 Contest1024 - 《挑战编程》第一章:入门 Problem A: The 3n + 1 problem(水题)

    Problem A: The 3n + 1 problem Time Limit: 1 Sec  Memory Limit: 64 MBSubmit: 14  Solved: 6[Submit][St ...

  5. Poj1298_The Hardest Problem Ever(水题)

    一.Description Julius Caesar lived in a time of danger and intrigue. The hardest situation Caesar eve ...

  6. POJ 2014:Flow Layout 模拟水题

    Flow Layout Time Limit: 1000MS   Memory Limit: 30000K Total Submissions: 3091   Accepted: 2148 Descr ...

  7. [POJ 1001] Exponentiation C++解题报告 JAVA解题报告

        Exponentiation Time Limit: 500MS   Memory Limit: 10000K Total Submissions: 126980   Accepted: 30 ...

  8. HDU 4716 A Computer Graphics Problem (水题)

    A Computer Graphics Problem Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (J ...

  9. POJ 1061 青蛙的约会 数论水题

    http://poj.org/problem?id=1061 傻逼题不多说 (x+km) - (y+kn) = dL 求k 令b = n-m ; a = x - y ; 化成模线性方程一般式 : Lx ...

随机推荐

  1. python生成器简单代码了理解。

    __author__ = 'ZHHT' #!/usr/bin/env python # -*- coding:utf-8 -*- #返回当前执行到的函数的返回值.并保持当前执行的状态.这时候先执行别的 ...

  2. CSS font-family 字体名称一览表

    windows常见内置中文字体 字体中文名 字体英文名 宋体                      SimSun(浏览器默认) 黑体                      SimHei 微软雅 ...

  3. RK3288开发过程中遇到的问题点和解决方法之Kernel

    修改背光改变区间 kernel\drivers\video\backlight\pwm_bl.c static int pwm_backlight_update_status(struct backl ...

  4. python中的random

    random.randint(a,b)    用于生成一个指定范围内的整数,a为下限,b为上限,生成的随机整数a<=n<=b;若a=b,则n=a:若a>b,报错 import ran ...

  5. 删除表中一个字段的SQL语句

    1.删除没有默认值的列:alter table Test drop COLUMN BazaarType 2.删除有默认值的列:先删除约束(默认值)alter table Test DROP CONST ...

  6. UVA 536 TreeRocvery 树重建 (递归)

    根据先序历遍和中序历遍输出后序历遍,并不需要真的建树,直接递归解决 #include<cstdio> #include<cstring> ; char preOrder[N]; ...

  7. lca(最近公共祖先(离线))

    转自大佬博客 : https://www.cnblogs.com/JVxie/p/4854719.html   LCA 最近公共祖先 Tarjan(离线)算法的基本思路及其算法实现 首先是最近公共祖先 ...

  8. sort 与 sorted 区别:

    sort 与 sorted 区别: sort 是应用在 list 上的方法,sorted 可以对所有可迭代的对象进行排序操作. list 的 sort 方法返回的是对已经存在的列表进行操作,无返回值, ...

  9. java基础—方法重载(overload)

    一.方法的重载 方法名一样,但参数不一样,这就是重载(overload). 所谓的参数不一样,主要有两点:第一是参数的个数不一样,第二是参数的类型不一样.只要这两方面有其中的一方面不一样就可以构成方法 ...

  10. iOS9适配总结

    每年iOS升级,都会带来一些坑,这次iOS9也不例外.本文总结了微信在适配iOS9上遇到的问题和解决方案. 一.iOS9问题汇总   1. 编译问题(Bitcode) 大部分人升级到Xcode7后,首 ...