【前言】
今天比赛的时候被200M的输出击败了,于是抄+改了一下快读的板子。
update:
这份代码是c++11的产物,如果没有开的话需要把
struct
\text{struct}
struct初始赋值写成构造函数的形式。
【参考代码】
#include<bits/stdc++.h>
using namespace std;
namespace IO
{
const int LEN=100000;
struct IO
{
char ibuf[LEN],obuf[LEN],*ih=ibuf+LEN,*oh=obuf,*lastin=ibuf+LEN,*lastout=obuf+LEN-1;
char getchar(){return (ih==lastin)&&(lastin=(ih=ibuf)+fread(ibuf,1,LEN,stdin),ih==lastin)?EOF:*ih++;}
void putchar(char x){if(oh==lastout)fwrite(obuf,1,oh-obuf,stdout),oh=obuf;*oh++=x;}
int read()
{
int ret=0,f=1;char c=getchar();
while(!isdigit(c)) {if(c=='-')f=0;c=getchar();}
while(isdigit(c)) ret=ret*10+(c^48),c=getchar();
return f?ret:-ret;
}
void reads(char *s)
{
char c=getchar();
while(!isalpha(c)) c=getchar();
while(isalpha(c)) *s++=c,c=getchar();
*s++='\0';
}
void write(int x){if(x<0)x=-x,putchar('-');if(x>9)write(x/10);putchar(x%10^48);}
void writesp(int x){write(x);putchar(' ');}
void writeln(int x){write(x);putchar('\n');}
void writes(char *s){while(isalpha(*s))putchar(*s++);}
~IO(){fwrite(obuf,1,oh-obuf,stdout);}
}I;
}
using namespace IO;
int main()
{
freopen("io.in","r",stdin);
freopen("io.out","w",stdout);
int n=I.read();
for(int i=-10;i<=n;++i) I.writeln(i);
char s[10];
I.reads(s+1);
I.writes(s+2);
return 0;
}