【模版】输入输出

下面是输入输出模版:题目【a+b】

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include<iostream>
#include<cstdio>
#include<cstdlib>
using namespace std;
 
inline int R(){
    int ret = 0, f = 1; char ch = getchar();
    for(; (ch < '0' || ch > '9') && ch != '-'; ch = getchar());
    if(ch == '-') f = -1, ch = getchar();
    for(; ch >= '0' && ch <= '9'; ch = getchar())
        ret = (ret << 3) + (ret << 1) + (ch - '0');
    return ret * f;
}
 
inline void W(int x){
    if(x < 0) putchar('-'), x = -x;
    if(x > 9) W(x / 10);
    putchar(x % 10 + '0');
}
 
int main(){
    int a = R(), b = R();
    W(a + b);
    return 0;
}
View Code

 

posted @   CzYoL  阅读(139)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示