A+B Problem
来源:互联网 发布:搜狗输入法云计算候选 编辑:程序博客网 时间:2024/06/07 11:00
- 输入
- 输入两个数,a,b
- 输出
- 输出a+b的值
- 样例输入
2 3
- 样例输出
5
- 提示
- 例如:
C语言版:
#include<stdio.h>
int main()
{
int a,b;
scanf("%d%d",&a,&b);
printf("%d\n",a+b);
}
C++版:
#include<iostream>
using namespace std;
int main()
{
int a,b;
cin>>a>>b;
cout<<a+b<<endl;
}
Java版:
import java.io.*;
import java.util.*;
public class Main
{
public static void main(String args[]) throws Exception
{
Scanner cin=new Scanner(System.in);
int a=cin.nextInt(),b=cin.nextInt();
System.out.println(a+b);
}
}
Java jdk 1.4 版
import java.io.*;
import java.util.*;
public class Main
{
public static void main (String args[]) throws Exception
{
BufferedReader stdin =
new BufferedReader(
new InputStreamReader(System.in));
String line = stdin.readLine();
StringTokenizer st = new StringTokenizer(line);
int a = Integer.parseInt(st.nextToken());
int b = Integer.parseInt(st.nextToken());
System.out.println(a+b);
}
}请注意不要输出过多提示性语句(如:“please input two numbers”),不然会WrongAnswer的
#include<stdio.h>int main(){ int a,b; scanf("%d%d",&a,&b); printf("%d\n",a+b);}
0 0
- problem 1000: A+B problem
- Problem 1000 A+B Problem
- Problem - 1000 A + B Problem
- A + B Problem
- A + B Problem
- 1000 A+B Problem
- 1001 A + B Problem
- A+B Problem
- 1000 A+B Problem
- A + B Problem
- A + B Problem
- 1000 A + B Problem
- 1000 A+B Problem
- A + B Problem
- A + B Problem II
- A + B Problem II
- POJ1001 -- A-B Problem
- A + B problem II
- Python中字符串连接、删除数组中指定元素、记录脚本运行时间
- 【ORACLE】impd expd的几个例子
- 时序图、活动图、状态图、协作图
- 前端css+jquery+javascript知识点积累(待续)
- ios中的DES/CBC模式加密
- A+B Problem
- 你需要一个什么样的网站开发流程?
- CPU线程调度
- perl函数说明(getgrnam)
- JavaEE各种疑难杂症、bug、要点总结
- 天马行空的生涯
- 括号配对问题
- perl函数说明(gethostbyaddr)
- 详解tomcat的内存配置