关闭同步

1
2
3
4
#define endl '\n'

std::ios::sync_with_stdio(0);
cin.tie(0);

读入挂

普通版

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include<cstdio>

inline void read(int &x) //看情况可去掉负数部分
{
int t = 1;
char ch = getchar();
while(ch < '0' || ch > '9') { if(ch == '-') t = -1; ch = getchar();}
x = 0;
while(ch >= '0' && ch <= '9'){ x=x*10+ch-'0'; ch = getchar(); }
x*=t;
}

void print(int i){
if(i<10){
putchar('0'+i);
return ;
}
print(i/10);
putchar('0'+i%10);
}

fread版

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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
const int BUF=40000000;
char Buf[BUF],*buf=Buf;
const int OUT=20000000;
char Out[OUT],*ou=Out;int Outn[30],Outcnt;
inline void write(int x){
if(!x)*ou++=48;
else{
for(Outcnt=0;x;x/=10)Outn[++Outcnt]=x%10+48;
while(Outcnt)*ou++=Outn[Outcnt--];
}
}
inline void writell(ll x){
if(!x)*ou++=48;
else{
for(Outcnt=0;x;x/=10)Outn[++Outcnt]=x%10+48;
while(Outcnt)*ou++=Outn[Outcnt--];
}
}
inline void writechar(char x){*ou++=x;}
inline void writeln(){*ou++='\n';}
inline void read(int&a){for(a=0;*buf<48;buf++);while(*buf>47)a=a*10+*buf++-48;}


//这句话放到代码中
fread(Buf,1,BUF,stdin);

//样例
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int BUF=40000000;
char Buf[BUF],*buf=Buf;
const int OUT=20000000;
char Out[OUT],*ou=Out;int Outn[30],Outcnt;
inline void write(int x){
if(!x)*ou++=48;
else{
for(Outcnt=0;x;x/=10)Outn[++Outcnt]=x%10+48;
while(Outcnt)*ou++=Outn[Outcnt--];
}
}
inline void writell(ll x){
if(!x)*ou++=48;
else{
for(Outcnt=0;x;x/=10)Outn[++Outcnt]=x%10+48;
while(Outcnt)*ou++=Outn[Outcnt--];
}
}
inline void writechar(char x){*ou++=x;}
inline void writeln(){*ou++='\n';}
inline void read(int&a){for(a=0;*buf<48;buf++);while(*buf>47)a=a*10+*buf++-48;}

int main(){
fread(Buf,1,BUF,stdin);
int a,b;
read(a),read(b);
write(a+b);
writeln();
fwrite(Out,1,ou-Out,stdout);
}