自己的缺省(sheng)源

write无力吐槽了

 1 #include <cstdio>
 2 #include <iostream>
 3 #include <algorithm>
 4 #include <cstring>
 5 #include <cmath>
 6 #define REP(i, s, n) for(int i = s; i <= n; i ++)
 7 #define RAP(i, n, s) for(int i = n; i >= s; i --)
 8 using namespace std;
 9 inline void read(int &x){
10     x = 0; int sig = 1; char ch = getchar();
11     while(!isdigit(ch)) { if(ch == '-') sig = -1; ch = getchar(); }
12     while(isdigit(ch)) x = 10 * x + ch - '0', ch = getchar();
13     x *= sig; return ;
14 }
15 inline void write(int x){
16     if(x == 0) { putchar('0'); return ; }
17     if(x < 0) putchar('-'), x = -x;
18     int len = 0, buf[20];
19     while(x) buf[len ++] = x % 10, x /= 10;
20     RAP(i, len - 1, 0) putchar(buf[i] + '0'); return ;
21 }
22 void init(){
23 
24     return ;
25 }
26 void work(){
27 
28     return ;
29 }
30 void print(){
31 
32     return ;
33 }
34 int main(){
35     init();
36     work();
37     print();
38     return 0;
39 }

 新版的:

 1 #include<iostream>
 2 #include<cstdio>
 3 #include<cmath>
 4 #include<algorithm>
 5 using namespace std;
 6 inline int read(){
 7     int x=0,sig=1;char ch=getchar();
 8     while(!isdigit(ch)){if(ch=='-') sig=-1;ch=getchar();}
 9     while(isdigit(ch)) x=10*x+ch-'0',ch=getchar();
10     return x*=sig;
11 }
12 inline void write(int x){
13     if(x==0){putchar('0');return;} if(x<0) putchar('-'),x=-x;
14     int len=0,buf[15]; while(x) buf[len++]=x%10,x/=10;
15     for(int i=len-1;i>=0;i--) putchar(buf[i]+'0');return;
16 }
17 void init(){
18     return;
19 }
20 void work(){
21     return;
22 }
23 void print(){
24     return;
25 }
26 int main(){
27     init();work();print();return 0;
28 }

 最新版的……

 1 #include<iostream>
 2 #include<cstdio>
 3 #include<cmath>
 4 #include<algorithm>
 5 #include<queue>
 6 #include<cstring>
 7 #define PAU putchar(' ')
 8 #define ENT putchar('\n')
 9 using namespace std;
10 inline int read(){
11     int x=0,sig=1;char ch=getchar();
12     while(!isdigit(ch)){if(ch=='-')sig=-1;ch=getchar();}
13     while(isdigit(ch))x=10*x+ch-'0',ch=getchar();
14     return x*=sig;
15 }
16 inline void write(int x){
17     if(x==0){putchar('0');return;}if(x<0)putchar('-'),x=-x;
18     int len=0,buf[15];while(x)buf[len++]=x%10,x/=10;
19     for(int i=len-1;i>=0;i--)putchar(buf[i]+'0');return;
20 }
21 void init(){
22     return;
23 }
24 void work(){
25     return;
26 }
27 void print(){
28     return;
29 }
30 int main(){init();work();print();return 0;}

 

你可能感兴趣的:(sh)