思路:
直接模拟就好了 要注意是大于等于不是等于
C
o
d
e
Code
Code:
#include <cstdio>
#include <iostream>
#include <string>
using namespace std
;
int T
;
string str
;
int main
()
{
scanf("%d", &T
);
for (int i
= 1; i
<= T
; ++i
)
{
cin
>>str
;
int len
= str
.size(),jl
= 0,jl2
= 0,nb
= 0;
for (int j
= 0; j
< len
; ++j
)
{
if (str
[j
] == 'D') jl
++;
if (str
[j
] == 'C') jl2
++;
if (str
[j
] == 'A') nb
++;
}
if(jl
>= 1||jl2
>= 2) printf("failed\n");
else if(nb
>= 3) printf("sp offer\n");
else printf("offer\n");
}
return 0;
}
转载请注明原文地址: https://lol.8miu.com/read-37641.html