题目描述
描述
Given two integers A and B, your task is to output their sum, A+B.
输入
输入描述:
The input contains of only one line, consisting of two integers A and B. (0 ≤ A,B ≤ 1 000)
输入样例:
1 1
输出
输出描述:
The output should contain only one number that is A+B.
输出样例:
2
HINT:时间限制:1.0s 内存限制:1.0GB
解题思路
就是加法运算
代码
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int m=sc.nextInt();
int s=m+n;
System.out.print(s);
}
}
本文介绍了一个简单的编程问题,即两个整数A和B的求和问题。输入包含两个整数A和B,范围在0到1000之间。通过Java代码实现加法运算并输出结果。此题目用于练习基本的数据输入输出及加法运算。
1082

被折叠的 条评论
为什么被折叠?



