快读快写模板

1.暂不支持处理负数
2.以A+B Problem为背景

#include<bits/stdc++.h>
using namespace std;
int num;

int read(){
	int res=0;
	int f=0;
	char c;
	while(c<'0'||c>'9')c=getchar();
	for(;;){
		res=res*10+c-'0';
		c=getchar();
		if(c<'0'||c>'9')break;
	}
	return res;
}

void write(int x){
	char stk[1000],top=0;
	while(x){
		stk[top++]=x%10+'0';
		x/=10;
	}
	for(int i=top-1;i>=0;i--)putchar(stk[i]);
}

int main(){
	int a=read(),b=read();
	write(a+b);
}
posted @ 2022-02-23 17:10  计算机知识杂谈  阅读(34)  评论(0编辑  收藏  举报