没有输出,求助!!!
查看原帖
没有输出,求助!!!
979537
caizehao楼主2023/5/28 20:58

代码如下:

#include <bits/stdc++.h>
#define int long long//防止见祖宗的神器
using namespace std;

int a[110],sum;
void scand(int &num){
	int f=1,x=0;
	char c=getchar();
	while(c=='-'){
		f=-f,c=getchar();
	}
	while(c<'0' || c>'9'){
		c=getchar();
	}
	while('0'<=c && c<='9'){
		x=(x<<3)+(x<<1)+(c^48),c=getchar();
	}
	num=f*x;
}
signed main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	while(a[sum]!=0){
		scand(a[++sum]);
	}
	for(int i=sum-1;i>=1;i--){
		cout << a[i] << ' ';
	}
	return 0;
}
2023/5/28 20:58
加载中...