A+B Problem
| Time Limit: 1000MS | Memory Limit: 10000K | |
| Total Submissions: 446656 | Accepted: 251482 |
Description
Calculate a+b
Input
Two integer a,b (0<=a,b<=10)
Output
Output a+b
Sample Input
1 2
Sample Output
3
一、题意
计算a+b
二、思路
三、代码
#include <iostream>
#include <sstream>
#include <iomanip>
#include <string>
#include <numeric>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <bitset>
#include <utility>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
using namespace std;
typedef long long ll;
const int MAXN = 100100;
const int MOD7 = 1000000007;
const int MOD9 = 1000000009;
const int INF = 2000000000;//0x7fffffff
const double EPS = 1e-9;
const double PI = 3.14159265358979;
const int dir_4r[] = { -1, 1, 0, 0 };
const int dir_4c[] = { 0, 0, -1, 1 };
const int dir_8r[] = { -1, -1, -1, 0, 0, 1, 1, 1 };
const int dir_8c[] = { -1, 0, 1, -1, 1, -1, 0, 1 };
int main() {
int a, b;
scanf("%d%d", &a, &b);
printf("%d\n", a + b);
//system("pause");
return 0;
}

本文介绍了一个简单的编程问题“A+B”,并给出了实现代码。该问题是计算两个整数a和b的和,输入范围限定在0到10之间。通过示例说明了如何使用C语言解决此问题。
187

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



