为什么只能通过一个测试点嘞 在自己的编译器上可以过QVQ

P1603 斯诺登的密码

调试了好久发现自己一开始没看懂题目 现在终于AC了OVO ```c #include<stdio.h> #include<string.h> int main(void){ char input[105]; int val[6]; int i,j,k,m,temp,ans=0; char str_check[26][10]={"one","two","three","four","five","six","seven","eight","nine","ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen","twenty"," a ","another","first","both","second","third"}; gets(input); for(i=0,j=0;i<26;i++){ if(strstr(input,str_check[i])!=NULL){ if(i<20){ val[j]=((i+1)*(i+1))%100; j++; } else if(i==20||i==21||i==22){ val[j]=(1*1)%100; j++; } else if(i==24||i==23){ val[j]=(2*2)%100; j++; } else if(i==25){ val[j]=(3*3)%100; j++; } } } if(j==0){ printf("0"); return 0; } for(k=1;k<=(j-1);k++){ for(m=0;m<(j-k);m++){ if(val[m]>val[m+1]){ temp=val[m]; val[m]=val[m+1]; val[m+1]=temp; } } } for(k=0;k<j;k++){ if(k>0){ printf("%02d",val[k]); } else printf("%d",val[k]); } return 0; } ```
by momo36524 @ 2024-03-21 16:05:39


|