Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1535527
  • 博文数量: 113
  • 博客积分: 3526
  • 博客等级: 中校
  • 技术积分: 1815
  • 用 户 组: 普通用户
  • 注册时间: 2009-09-08 09:46
个人简介

记录总结自己的工作

文章分类

全部博文(113)

文章存档

2015年(19)

2014年(10)

2013年(6)

2012年(16)

2011年(24)

2010年(21)

2009年(17)

分类: C/C++

2012-08-22 10:38:09

Description

Calculate a+b

Input

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

Output

Output a+b

Sample Input

1 2

Sample Output

3

JAVA:

点击(此处)折叠或打开

  1. import java.util.Scanner;

  2. public class Main {
  3.     public static void main(String[] args) {
  4.         Scanner cin=new Scanner(System.in);
  5.         int a=cin.nextInt(),b=cin.nextInt();
  6.         System.out.println(a+b);
  7.     }
  8. }
结果:
3024K657MS
C:

点击(此处)折叠或打开

  1. #include <stdio.h>
  2. int main(){
  3.     int a, b;
  4.     scanf("%d %d",&a, &b);
  5.     printf("%d\n",a+b);
  6.     return 0;
  7. }
结果:
396K16MS
阅读(1713) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~