赛后judge了下一些可以看到的同学的代码:发现小舜萌猫喵读错题了,un和nil在一起是不用处理的(从英文角度来讲ennnil很不和谐,unnil却可以忍)~~~然后戴神带来的小弟(rookie11-032)先是赛后怀疑明明出的题数据有问题,我这个题他竟然打了个14000+的表,有点儿我当年的“风采”,可以打的表我一眼就看出了错误(囧)rookie11-035 data2读不进来。。。不知为什么,然后他就TLE了,很可惜的是rookie11-043很可爱的忘把freopen去掉了,然后就WA了,不然他就1A了。我出题的目的当然是这个题可以AC,但1A是有难度滴,不过陆神在测题时1A了,强烈ORZ!!!!!!
#include <stdio.h> #include <string.h> char number[10][5]={"nil", "un", "bi", "tri", "quad", "pent", "hex", "sept", "oct", "enn",}; char a, b, c, element[20]; int t, flag; int main() { scanf ("%d", &t); while (t--){ scanf ("%d", &flag); getchar(); if (flag == 1){ scanf ("%c%c%c", &a, &b, &c); printf("%c", number[a - '0'][0] - 'a' + 'A'); if (a == '9' && b == '0') printf("%s%s", number[a - '0'] + 1, number[b - '0'] + 1); else printf("%s%s", number[a - '0'] + 1, number[b - '0']); if (b == '9' && c =='0') printf("%s%s\n", number[c - '0'] + 1, "ium"); else if (c == '2' || c == '3') printf("%s%s\n", number[c - '0'], "um"); else printf("%s%s\n", number[c - '0'], "ium"); } if (flag == 2){ scanf("%s", element); element[0] = element[0] - 'A' + 'a'; int loc = 0, sum = 3; while(sum){ int i = 0; for (; i <= 9; i++){ printf("%"); if (strstr(element + loc, number[i]) == (element + loc)){ printf("%d", i); loc += strlen(number[i]); if(element[loc]=='i') loc--; --sum, i = 0; } } } printf("\n"); } } return 0; }