跳到正文

休闲·娱乐

码 风 新 奇

HydrogenOxygen约 22 分钟
原文
文章信息与版本

文章信息

发布
2025年11月8日
收录
2025年12月12日
更新
2026年11月3日
篇幅
约 22 分钟

版本

  1. v1当前
C++
extern"C" int getchar();
extern"C" int putchar(int);
namespace myfastio{
	class istream{
		bool ex,pre;
	public:
		istream&operator>>(int&x){
			if(pre)ex=true;
			x=0;
			if(pre)return*this;
			int f=1;
			char c=getchar();
			while(!(48<=c&&c<58)){if(!(~c)){pre=true;return*this;}if(c=='-')f*=-1;c=getchar();}
			while(48<=c&&c<58){x=(x<<3)+(x<<1)+(c-48);c=getchar();}
			x=x*f;
			if(!(~c)){pre=true;return*this;}
			return*this;
		}
		istream&operator>>(long&x){
			if(pre)ex=true;
			x=0;
			if(pre)return*this;
			int f=1;
			char c=getchar();
			while(!(48<=c&&c<58)){if(!(~c)){pre=true;return*this;}if(c=='-')f*=-1;c=getchar();}
			while((48<=c&&c<58)){x=(x<<3)+(x<<1)+(c-48);c=getchar();}
			x=x*f;
			if(!(~c)){pre=true;return*this;}
			return*this;
		}
		istream&operator>>(long long&x){
			if(pre)ex=true;
			x=0;
			if(pre)return*this;
			int f=1;
			char c=getchar();
			while(!(48<=c&&c<58)){if(!(~c)){pre=true;return*this;}if(c=='-')f*=-1;c=getchar();}
			while((48<=c&&c<58)){x=(x<<3)+(x<<1)+(c-48);c=getchar();}
			x=x*f;
			if(!(~c)){pre=true;return*this;}
			return*this;
		}
		istream&operator>>(unsigned int&x){
			if(pre)ex=true;
			x=0;
			if(pre)return*this;
			int f=1;
			char c=getchar();
			while(!(48<=c&&c<58)){if(!(~c)){pre=true;return*this;}if(c=='-')f*=-1;c=getchar();}
			while(48<=c&&c<58){x=(x<<3)+(x<<1)+(c-48);c=getchar();}
			x=x*f;
			if(!(~c)){pre=true;return*this;}
			return*this;
		}
		istream&operator>>(long unsigned int&x){
			if(pre)ex=true;
			x=0;
			if(pre)return*this;
			int f=1;
			char c=getchar();
			while(!(48<=c&&c<58)){if(!(~c)){pre=true;return*this;}if(c=='-')f*=-1;c=getchar();}
			while((48<=c&&c<58)){x=(x<<3)+(x<<1)+(c-48);c=getchar();}
			x=x*f;
			if(!(~c)){pre=true;return*this;}
			return*this;
		}
		istream&operator>>(long long unsigned int&x){
			if(pre)ex=true;
			x=0;
			if(pre)return*this;
			int f=1;
			char c=getchar();
			while(!(48<=c&&c<58)){if(!(~c)){pre=true;return*this;}if(c=='-')f*=-1;c=getchar();}
			while((48<=c&&c<58)){x=(x<<3)+(x<<1)+(c-48);c=getchar();}
			x=x*f;
			if(!(~c)){pre=true;return*this;}
			return*this;
		}
		istream&operator>>(char&c){
			if(pre)ex=true;
			if(pre)return*this;
			c=getchar();
			while(c<=32||c==127){if(!(~c)){pre=true;return*this;}c=getchar();}
			return*this;
		}
		istream&operator>>(float&x){
			if(pre)ex=true;
			x=0;
			if(pre)return*this;
			int f=1;
			char c=getchar();
			while(!(48<=c&&c<58)){if(!(~c)){pre=true;return*this;}if(c=='-')f*=-1;c=getchar();}
			while(48<=c&&c<58){x=x*10+(c-48);c=getchar();}
			if(c=='.'){
				c=getchar();
				double pos=1e-1;
				while(48<=c&&c<58){x=pos*(c-48);c=getchar();pos*=1e-1;}
			}
			x=x*f;
			if(!(~c)){pre=true;return*this;}
			return*this;
		}
		istream&operator>>(double&x){
			if(pre)ex=true;
			x=0;
			if(pre)return*this;
			int f=1;
			char c=getchar();
			while(!(48<=c&&c<58)){if(!(~c)){pre=true;return*this;}if(c=='-')f*=-1;c=getchar();}
			while(48<=c&&c<58){x=x*10+(c-48);c=getchar();}
			if(c=='.'){
				c=getchar();
				double pos=1e-1;
				while(48<=c&&c<58){x=pos*(c-48);c=getchar();pos*=1e-1;}
			}
			x=x*f;
			if(!(~c)){pre=true;return*this;}
			return*this;
		}
		istream&operator>>(long double&x){
			if(pre)ex=true;
			x=0;
			if(pre)return*this;
			int f=1;
			char c=getchar();
			while(!(48<=c&&c<58)){if(!(~c)){pre=true;return*this;}if(c=='-')f*=-1;c=getchar();}
			while(48<=c&&c<58){x=x*10+(c-48);c=getchar();}
			if(c=='.'){
				c=getchar();
				double pos=1e-1;
				while(48<=c&&c<58){x=pos*(c-48);c=getchar();pos*=1e-1;}
			}
			x=x*f;
			if(!(~c)){pre=true;return*this;}
			return*this;
		}
	#ifdef _GLIBCXX_STRING
		istream&operator>>(std::string&s){
			if(pre)ex=true;
			if(pre)return*this;
			char c;
			*this>>c;
			while(!(c<=32||c==127)){s+=c,c=getchar();}
			if(!(~c))pre=true;
			return*this;
		}
	#endif
		bool ok(){return!ex;}
	}cin;
	class Setprecision{
	public:
		int precision;
	};
	Setprecision setprecision(int pre){return{pre};}
	class ostream{
		long double precision;
	public:
		ostream(){precision=1e-6;}
		ostream&operator<<(int x){
			if(x<0)putchar('-'),x=-x;
			if(x>9)*this<<x/10;
			putchar(x%10+'0');
			return*this;
		}
		ostream&operator<<(long x){
			if(x<0)putchar('-'),x=-x;
			if(x>9)*this<<x/10;
			putchar(x%10+'0');
			return*this;
		}
		ostream&operator<<(long long x){
			if(x<0)putchar('-'),x=-x;
			if(x>9)*this<<x/10;
			putchar(x%10+'0');
			return*this;
		}
		ostream&operator<<(unsigned int x){
			if(x>9)*this<<x/10;
			putchar(x%10+'0');
			return*this;
		}
		ostream&operator<<(long unsigned int x){
			if(x>9)*this<<x/10u;
			putchar(x%10+'0');
			return*this;
		}
		ostream&operator<<(long long unsigned int x){
			if(x>9)*this<<x/10;
			putchar(x%10+'0');
			return*this;
		}
		ostream&operator<<(char c){
			putchar(c);
			return*this;
		}
		ostream&operator<<(float x){
			if(x<0)putchar('-'),x=-x;
			*this<<(long long unsigned int)x;
			x-=(long long unsigned int)x;
			putchar('.');
			for(long double i=1e-1;i>=(precision>1e-6?precision:1e-6);i*=1e-1){
				int val=(x+precision)/i;
				putchar(val+'0');
				x-=val*i;
			}
			return*this;
		}
		ostream&operator<<(double x){
			if(x<0)putchar('-'),x=-x;
			*this<<(long long unsigned int)x;
			x-=(long long unsigned int)x;
			putchar('.');
			for(long double i=1e-1;i>=(precision>1e-15?precision:1e-15);i*=1e-1){
				int val=(x+precision)/i;
				putchar(val+'0');
				x-=val*i;
			}
			return*this;
		}
		ostream&operator<<(long double x){
			if(x<0)putchar('-'),x=-x;
			*this<<(long long unsigned int)x;
			x-=(long long unsigned int)x;
			putchar('.');
			for(long double i=1e-1;i>=(long double)(precision>1e-20?precision:1e-20);i*=1e-1){
				int val=(x+precision)/i;
				putchar(val+'0');
				x-=val*i;
			}
			return*this;
		}
		ostream&operator<<(Setprecision prec){
			int p=prec.precision;
			precision=1;
			while(p--){
				precision*=1e-1;
			}
			return*this;
		}
	#ifdef _GLIBCXX_STRING
		ostream&operator<<(std::string s){
			for(int i=0;i<s.size();i++)*this<<s[i];
			return*this;
		}
	#endif
	}cout;
}
using namespace myfastio;
int a,b;
int main(){
	cin>>a>>b;
	cout<<a+b;
	return 0;
}
C++
extern"C" int getchar();extern"C" int putchar(int);namespace myfastio{class istream{bool ex,pre;public:istream&operator>>(int&x){if(pre)ex=true;x=0;if(pre)return*this;int f=1;char c=getchar();while(!(48<=c&&c<58)){if(!(~c)){pre=true;return*this;}if(c=='-')f*=-1;c=getchar();}while(48<=c&&c<58){x=(x<<3)+(x<<1)+(c-48);c=getchar();}x=x*f;if(!(~c)){pre=true;return*this;}return*this;}istream&operator>>(long&x){if(pre)ex=true;x=0;if(pre)return*this;int f=1;char c=getchar();while(!(48<=c&&c<58)){if(!(~c)){pre=true;return*this;}if(c=='-')f*=-1;c=getchar();}while((48<=c&&c<58)){x=(x<<3)+(x<<1)+(c-48);c=getchar();}x=x*f;if(!(~c)){pre=true;return*this;}return*this;}istream&operator>>(long long&x){if(pre)ex=true;x=0;if(pre)return*this;int f=1;char c=getchar();while(!(48<=c&&c<58)){if(!(~c)){pre=true;return*this;}if(c=='-')f*=-1;c=getchar();}while((48<=c&&c<58)){x=(x<<3)+(x<<1)+(c-48);c=getchar();}x=x*f;if(!(~c)){pre=true;return*this;}return*this;}istream&operator>>(unsigned int&x){if(pre)ex=true;x=0;if(pre)return*this;int f=1;char c=getchar();while(!(48<=c&&c<58)){if(!(~c)){pre=true;return*this;}if(c=='-')f*=-1;c=getchar();}while(48<=c&&c<58){x=(x<<3)+(x<<1)+(c-48);c=getchar();}x=x*f;if(!(~c)){pre=true;return*this;}return*this;}istream&operator>>(long unsigned int&x){if(pre)ex=true;x=0;if(pre)return*this;int f=1;char c=getchar();while(!(48<=c&&c<58)){if(!(~c)){pre=true;return*this;}if(c=='-')f*=-1;c=getchar();}while((48<=c&&c<58)){x=(x<<3)+(x<<1)+(c-48);c=getchar();}x=x*f;if(!(~c)){pre=true;return*this;}return*this;}istream&operator>>(long long unsigned int&x){if(pre)ex=true;x=0;if(pre)return*this;int f=1;char c=getchar();while(!(48<=c&&c<58)){if(!(~c)){pre=true;return*this;}if(c=='-')f*=-1;c=getchar();}while((48<=c&&c<58)){x=(x<<3)+(x<<1)+(c-48);c=getchar();}x=x*f;if(!(~c)){pre=true;return*this;}return*this;}istream&operator>>(char&c){if(pre)ex=true;if(pre)return*this;c=getchar();while(c<=32||c==127){if(!(~c)){pre=true;return*this;}c=getchar();}return*this;}istream&operator>>(float&x){if(pre)ex=true;x=0;if(pre)return*this;int f=1;char c=getchar();while(!(48<=c&&c<58)){if(!(~c)){pre=true;return*this;}if(c=='-')f*=-1;c=getchar();}while(48<=c&&c<58){x=x*10+(c-48);c=getchar();}if(c=='.'){c=getchar();double pos=1e-1;while(48<=c&&c<58){x=pos*(c-48);c=getchar();pos*=1e-1;}}x=x*f;if(!(~c)){pre=true;return*this;}return*this;}istream&operator>>(double&x){if(pre)ex=true;x=0;if(pre)return*this;int f=1;char c=getchar();while(!(48<=c&&c<58)){if(!(~c)){pre=true;return*this;}if(c=='-')f*=-1;c=getchar();}while(48<=c&&c<58){x=x*10+(c-48);c=getchar();}if(c=='.'){c=getchar();double pos=1e-1;while(48<=c&&c<58){x=pos*(c-48);c=getchar();pos*=1e-1;}}x=x*f;if(!(~c)){pre=true;return*this;}return*this;}istream&operator>>(long double&x){if(pre)ex=true;x=0;if(pre)return*this;int f=1;char c=getchar();while(!(48<=c&&c<58)){if(!(~c)){pre=true;return*this;}if(c=='-')f*=-1;c=getchar();}while(48<=c&&c<58){x=x*10+(c-48);c=getchar();}if(c=='.'){c=getchar();double pos=1e-1;while(48<=c&&c<58){x=pos*(c-48);c=getchar();pos*=1e-1;}}x=x*f;if(!(~c)){pre=true;return*this;}return*this;}bool ok(){return!ex;}}cin;class Setprecision{public:int precision;};Setprecision setprecision(int pre){return{pre};}class ostream{long double precision;public:ostream(){precision=1e-6;}ostream&operator<<(int x){if(x<0)putchar('-'),x=-x;if(x>9)*this<<x/10;putchar(x%10+'0');return*this;}ostream&operator<<(long x){if(x<0)putchar('-'),x=-x;if(x>9)*this<<x/10;putchar(x%10+'0');return*this;}ostream&operator<<(long long x){if(x<0)putchar('-'),x=-x;if(x>9)*this<<x/10;putchar(x%10+'0');return*this;}ostream&operator<<(unsigned int x){if(x>9)*this<<x/10;putchar(x%10+'0');return*this;}ostream&operator<<(long unsigned int x){if(x>9)*this<<x/10u;putchar(x%10+'0');return*this;}ostream&operator<<(long long unsigned int x){if(x>9)*this<<x/10;putchar(x%10+'0');return*this;}ostream&operator<<(char c){putchar(c);return*this;}ostream&operator<<(float x){if(x<0)putchar('-'),x=-x;*this<<(long long unsigned int)x;x-=(long long unsigned int)x;putchar('.');for(long double i=1e-1;i>=(precision>1e-6?precision:1e-6);i*=1e-1){int val=(x+precision)/i;putchar(val+'0');x-=val*i;}return*this;}ostream&operator<<(double x){if(x<0)putchar('-'),x=-x;*this<<(long long unsigned int)x;x-=(long long unsigned int)x;putchar('.');for(long double i=1e-1;i>=(precision>1e-15?precision:1e-15);i*=1e-1){int val=(x+precision)/i;putchar(val+'0');x-=val*i;}return*this;}ostream&operator<<(long double x){if(x<0)putchar('-'),x=-x;*this<<(long long unsigned int)x;x-=(long long unsigned int)x;putchar('.');for(long double i=1e-1;i>=(long double)(precision>1e-20?precision:1e-20);i*=1e-1){int val=(x+precision)/i;putchar(val+'0');x-=val*i;}return*this;}ostream&operator<<(Setprecision prec){int p=prec.precision;precision=1;while(p--){precision*=1e-1;}return*this;}}cout;}using namespace myfastio;int a,b;int main(){cin>>a>>b;cout<<a+b;return 0;}
原文