社区讨论
关于A
学术版参与者 4已保存回复 4
讨论操作
快速查看讨论及其快照的属性,并进行相关操作。
- 当前回复
- 4 条
- 当前快照
- 1 份
- 快照标识符
- @lo8czk0h
- 此快照首次捕获于
- 2023/10/27 16:36 2 年前
- 此快照最后确认于
- 2023/10/27 16:36 2 年前
rt,为什么没过
CPP#include<bits/stdc++.h>
using namespace std;
int a[20];char c[20];
int main(){
int t;
cin>>t;
while(t--){
memset(a,0,sizeof(a));
cin>>c;
for(int i=0;i<strlen(c);i++){
if(c[i]>='0'&&c[i]<='9')a[c[i]-'0']++;
else if(c[i]=='T')a[10]++;
else if(c[i]=='J')a[11]++;
else if(c[i]=='Q')a[12]++;
else if(c[i]=='K')a[13]++;
else if(c[i]=='X')a[14]++;
else if(c[i]=='D')a[14]++;
}
int flag=1;
for(int i=1;i<=14;i++){
if(a[i]==4){
cout<<"yes"<<endl;
flag=0;
break;
}
else if(a[i]==2&&i==14){
cout<<"yes"<<endl;
flag=0;
break;
}
}
if(flag==1)cout<<"no"<<endl;
}
return 0;
}
回复
共 4 条回复,欢迎继续交流。
正在加载回复...