关于一个代码
  • 板块灌水区
  • 楼主lianchanghua
  • 当前回复1
  • 已保存回复1
  • 发布时间2023/10/20 15:30
  • 上次更新2023/11/2 12:33:47
查看原帖
关于一个代码
564475
lianchanghua楼主2023/10/20 15:30

老师题目附件中的,但似乎没用?我输入后不给输出,并且把模板扣到别的代码上会CE,是我食用方法不对吗?如果是,大佬们教下我怎么使用吧,谢谢!

#include<bits/stdc++.h>
using namespace std;
struct IO{
    static const int S=1<<21;
    char buf[S],*p1,*p2;int st[105],Top;
    ~IO(){clear();}
    inline void clear(){fwrite(buf,1,Top,stdout);Top=0;}
    inline void pc(const char c){Top==S&&(clear(),0);buf[Top++]=c;}
    inline char gc(){return p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++;}
    inline IO&operator >> (char&x){while(x=gc(),x==' '||x=='\n'||x=='\r');return *this;}
    template<typename T>inline IO&operator >> (T&x){
        x=0;bool f=0;char ch=gc();
        while(ch<'0'||ch>'9'){if(ch=='-') f^=1;ch=gc();}
        while(ch>='0'&&ch<='9') x=(x<<3)+(x<<1)+ch-'0',ch=gc();
        f?x=-x:0;return *this;
    }
    inline IO&operator << (const char c){pc(c);return *this;}
    template<typename T>inline IO&operator << (T x){
        if(x<0) pc('-'),x=-x;
        do{st[++st[0]]=x%10,x/=10;}while(x);
        while(st[0]) pc('0'+st[st[0]--]);return *this;
    }
}fin,fout;
int main(){
	int a,b;
	fin>>a>>b;
	fout<<a+b<<'\n';
}
2023/10/20 15:30
加载中...