Kattis-Add Two Numbers

Posted 做一个AC梦

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Kattis-Add Two Numbers相关的知识,希望对你有一定的参考价值。

题目所述基本内容

In this problem, your program should read two whole numbers (also called integers) from the input, and print out their sum.

As a refresher, here are some ways to read two numbers from standard input in a few different languages:

# Python 3
line = input()
a, b = line.split()
a = int(a)
b = int(b)

// C++
// make sure to first "#include <iostream>"
int a, b;
std::cin >> a >> b;

// Java
// make sure to first "import java.util.Scanner;"
Scanner s = new Scanner(System.in);
int a = s.nextInt(), b = s.nextInt();

输入输出样例

Input

The input contains one line, which has two integers a and b, separated by a single space. The bounds on these values are 0≤a,b≤1000000.

Output

Output the sum of the two integers, a+b.

代码

#include<iostream>
using namespace std;

int main() 
	int a, b;
	cin >> a >> b;
	cout << a + b << endl;

结束语

好兄弟好兄弟,留下你的关注和点赞,666走一波!!!!!

以上是关于Kattis-Add Two Numbers的主要内容,如果未能解决你的问题,请参考以下文章

Add Two Numbers

Add Two Numbers

2. Add Two Numbers

[算法练习]Add Two Numbers

链表-Add Two Numbers

LC.02. Add Two Numbers