Description

A + B Problem
Calculate a + b

Standard Input

Two integer a, b.

Standard Output

Output a + b

Samples

Input Output
1 2 3
2 3 5
5 6 11

Constraints

0 \leq a, b \leq 10

Soulution

From the problem, we need to calculate the sum of two integers, the two input integers are less than or equal to 10. We can choose the unsigned int variable to store the two integers, and then output their sum

#include <iostream>
using namespace std;
int main(void) 
{
	unsigned short a, b;
	cin >> a >> b;
	cout << a + b;
	
	return 0;
}

[Lutece] #1 A+B Problem

Summary

I feel that using unsigned short doesn’t seem to make much difference from int.

相关文章:

  • 2021-09-09
  • 2021-10-12
  • 2022-12-23
  • 2021-06-01
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-05-18
  • 2022-12-23
  • 2021-07-19
  • 2021-09-26
相关资源
相似解决方案