又一个快读快写
ravenmvp
5/2/2026
信息学
6 次阅读
cpp
#include<bits/stdc++.h>
using namespace std;
struct control{
int ct,val;
control(int Ct,int Val=-1):ct(Ct),val(Val){}
control operator()(int Val){
return control(ct,Val);
}
}_endl(0),_prs(1),_setprecision(2);
struct FastIO{
#define IOSIZE 1000000
char in[IOSIZE],*p,*pp,out[IOSIZE],chr[20],*q,*qq,*t,b,K,prs;
FastIO():p(in),pp(in),q(out),qq(out+IOSIZE),t(chr),b(1),K(6){}
~FastIO(){fwrite(out,1,q-out,stdout);}
char getch(){
return p==pp&&(pp=(p=in)+fread(in,1,IOSIZE,stdin),p==pp)?b=0,EOF:*p++;
}
void putch(char x){
q==qq&&(fwrite(out,1,q-out,stdout),q=out),*q++=x;
}
void puts(const char str[]){fwrite(out,1,q-out,stdout),fwrite(str,1,strlen(str),stdout),q=out;}
void getline(string& s){
s="";
for(char ch;(ch=getch())!='\n'&&b;)s+=ch;
}
template<typename T> FastIO& operator>>(T& x){
x=0;char f=0,ch;
while(!isdigit(ch=getch())&&b)f|=ch=='-';
while(isdigit(ch))x=(x<<1)+(x<<3)+(ch^48),ch=getch();
return x=f?-x:x,*this;
}
FastIO& operator>>(char& ch){return ch=getch(),*this;}
FastIO& operator>>(string& s){
s="";char ch;
while(isspace(ch=getch())&&b);
while(!isspace(ch)&&b)s+=ch,ch=getch();
return *this;
}
FastIO& operator>>(double& x){
x=0;char f=0,ch;
double d=0.1;
while(!isdigit(ch=getch())&&b)f|=(ch=='-');
while(isdigit(ch))x=x*10+(ch^48),ch=getch();
if(ch=='.')while(isdigit(ch=getch()))x+=d*(ch^48),d*=0.1;
return x=f?-x:x,*this;
}
template<typename _T> FastIO& operator<<(_T x){
!x&&(putch('0'),0),x<0&&(putch('-'),(x=-x));
while(x)*t++=x%10+48,x/=10;
while(t!=chr)*q++=*--t;
return *this;
}
FastIO& operator<<(char ch){return putch(ch),*this;}
FastIO& operator<<(const char str[]){return puts(str),*this;}
FastIO& operator<<(const string& s){return puts(s.c_str()),*this;}
FastIO& operator<<(double x){
int k=0;
this->operator<<(int(x));
putch('.');
x-=int(x);
prs&&(x+=5*pow(10,-K-1));
while(k<K)putch(int(x*=10)^48),x-=int(x),++k;
return *this;
}
FastIO& operator<<(const control& cl){
switch(cl.ct){
case 0:putch('\n');break;
case 1:prs=cl.val;break;
case 2:K=cl.val;break;
}
return *this;
}
operator bool(){return b;}
}io;
int main(){
int a,b;
io>>a>>b;
io<<a+b<<_endl;
return 0;
}