Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
93511 | 胡海峰老师 | 破译邮件 | C | Wrong Answer | 1 MS | 200 KB | 1116 | 2024-10-17 15:12:35 |
#include <stdio.h> #include <string.h> #define MAX_LENGTH 101 int main() { int C; scanf("%d", &C); // 读取测试数据的组数 while (C--) { char input[MAX_LENGTH]; scanf("%s", input); // 读取待破译的字符串 char output[MAX_LENGTH]; int outputIndex = 0; int num=0,tmp; for (int i = 0; input[i] != '\0'; i++) { if (input[i] >= '0' && input[i] <= '9') { tmp = input[i] - '0'; num = num*10 + tmp; } else if (input[i] == '#') { output[outputIndex++] = num+64; output[outputIndex++] = ' '; num =0; } else if (input[i] == '-') { // 忽略'-' output[outputIndex++] = num+64; num =0; continue; } } output[outputIndex++] = num+64; output[outputIndex] = '\0'; // 确保输出字符串以空字符结尾 printf("%s\n", output); // 输出破译后的文本 } return 0; }
------Input------
10 1#2#3#4#5#6#7#8#9#10#11#12#13#14#15#16#17#18#19#20#21#22#23#24#25#26 11-26-4-5######12-2#17-18-19-20## #9-10-11##25#26#1#2#3-1-3-1# #################### 1-2-3-4-5-6-7-8-9-10-11-12-13-14-15-16-17-18-19-20-21-22-23-24-25-26 #####23-24-25-26#1#2#3#4#5#6-7-8-9-10########1-2-3-4-5-6-7-8-9-10-11-12-13-14-15-16-17-18-19-20-21-6 ################26#################### ########1-2##3-4################# 2-24 3#23
------Answer-----
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z KZDE LB QRST IJK Y Z A B CACA ABCDEFGHIJKLMNOPQRSTUVWXYZ WXYZ A B C D E FGHIJ ABCDEFGHIJKLMNOPQRSTUF Z AB CD BX C W
------Your output-----
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z KZDE @ @ @ @ @ LB QRST @ @ @ IJK @ Y Z A B CACA @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ ABCDEFGHIJKLMNOPQRSTUVWXYZ @ @ @ @ @ WXYZ A B C D E FGHIJ @ @ @ @ @ @ @ ABCDEFGHIJKLMNOPQRSTUF @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ Z @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ AB @ CD @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ @ BX C W