输入输出优化(来自LG)

来源:互联网 发布:erg需要理论 知乎 编辑:程序博客网 时间:2024/04/30 00:06
    #include<iostream>      #include<cstdio>      using namespace std;      void read(int &x){          x=0;char c=getchar();          while(c<'0' || c>'9')c=getchar();          while(c>='0' && c<='9'){              x=x*10+c-'0';              c=getchar();          }       }      void write(int x){          int y=10,len=1;          while(y<=x)  {y*=10;len++;}          while(len--){y/=10;putchar(x/y+48);x%=y;}      }      int main(){          freopen("tt.in","r",stdin);          freopen("tt.out","w",stdout);          int i,j,k,m,n;            //for(i=1;i<=10000000;i++){read(n);printf("%d ",n);}          for(i=1;i<=10000000;i++){read(n);write(n);putchar(' ');}          return 0;      }  
0 0
原创粉丝点击