求助快读怎么写
  • 板块学术版
  • 楼主hexuchen
  • 当前回复13
  • 已保存回复13
  • 发布时间2023/10/4 14:54
  • 上次更新2023/11/2 15:49:51
查看原帖
求助快读怎么写
945742
hexuchen楼主2023/10/4 14:54

rt,自己在网上找了一个,但是输出结果前面都会多一个1

#include <bits/stdc++.h>
using namespace std;
int read(){
	int a=1,sum=1;
	char c=getchar();
	while(c<'0' || c>'9'){
		c=getchar();
	}
	while(c>='0' && c<='9'){
		sum=sum*10+c-'0';
		c=getchar();
	}
	return a*sum;
}
int main(){
	int a,b;
	a=read();
	b=read();
	cout<<a<<endl<<b;
	return 0;
}

Input 1 2

Output 11 12

2023/10/4 14:54
加载中...