社区讨论
样例对,提交全WA
B3868[GESP202309 三级] 进制判断参与者 3已保存回复 2
讨论操作
快速查看讨论及其快照的属性,并进行相关操作。
- 当前回复
- 2 条
- 当前快照
- 1 份
- 快照标识符
- @mlhzq1cu
- 此快照首次捕获于
- 2026/02/11 20:12 上周
- 此快照最后确认于
- 2026/02/13 19:45 6 天前
CPP
#include<bits/stdtr1c++.h>
using namespace std;
int main(){
string str[10005];
bool bin=1,oct=1,dec=1,hex=1;
int n;cin>>n;
for(int i=1;i<=n;i++)cin>>str[i];
for(int i=1;i<=n;i++){
bin=oct=dec=hex=1;
for(int j=1;j<=str[i].size();j++){
if(str[i][j]>='A'&&str[i][j]<='F')bin=oct=dec=0;
if(str[i][j]>'7')bin=oct=0;
if(str[i][j]>'1')bin=0;
if(str[i][j]>'F')bin=oct=dec=hex=0;
}
cout<<bin<<' '<<oct<<' '<<dec<<' '<<hex<<endl;
}
return 0;
}
回复
共 2 条回复,欢迎继续交流。
正在加载回复...