???!!!
查看原帖
???!!!
1241741
FanZhiyu1楼主2024/7/27 17:08

为什么会爆0啊啊啊啊(蒟蒻不解)
代码贴底下了,请神犇救救我!

#include<bits/stdc++.h>
using namespace std;
bool a[1005][5];
int main()
{
	int n;
	string tmp;
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>tmp;
		for(int k=0;k<tmp.size();k++){
			if(tmp[k]>='A'&&tmp[k]<='F'){
				a[i][4]=1;
				break;
			}
			else if(tmp[k]>='0'&&tmp[k]<='9'){
				a[i][4]=1;
				a[i][3]=1;
				if(tmp[k]>='8'){
					a[i][2]=0;
					a[i][1]=0;
				}
				else if(tmp[k]>='2'){
					a[i][2]=1;
					a[i][1]=0;
				}
				else{
					a[i][2]=1;
					a[i][1]=1;
				}
			}
		}
	}
	for(int i=1;i<=n;i++){
		for(int j=1;j<=4;j++)
			cout<<a[i][j]<<" ";
		cout<<endl;
	}
	return 0;
}
2024/7/27 17:08
加载中...