1 solutions
-
0
C++ :
#include<iostream> #include<cstdio> #include<cstring> using namespace std; char a[23][4]= {"啊","芭","擦","搭","蛾","发","噶","哈","击","喀","垃","妈","拿","哦","啪","期","然","撒","塌","挖","昔","压","匝"}; char m[23]= {'A','B','C','D','E','F','G','H','J','K','L','M','N','O','P','Q','R','S','T','W','X','Y','Z'}; int main() { int n,j; cin>>n; while(n--) { string ab; string ans; cin>>ab; char b[3]; b[2]='\0'; for(int i=0; ab[i]!='\0'; i+=2) { b[0]=ab[i]; b[1]=ab[i+1]; for(j=0; j<22; j++) if(strcmp(b,a[j])>=0&&strcmp(b,a[j+1])<0) break; ans+=m[j]; } cout<<ans<<endl; } return 0; }
- 1
Information
- ID
- 18327
- Time
- 1000ms
- Memory
- 128MiB
- Difficulty
- (None)
- Tags
- # Submissions
- 0
- Accepted
- 0
- Uploaded By