import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.PrintWriter; public class Main { public static void main(String[] args) throws IOException { BufferedReader sc = new BufferedReader(new InputStreamReader(System.in)); PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out)); char[] L = "*ABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharArray(); char[] c = sc.readLine().toCharArray(); if(c.length==1){System.out.println(L[c[0]-'0']);return;} for (int i = 0; i < c.length; i++) { int a = Integer.parseInt("" + c[i] + c[i + 1]); if (i == c.length - 3) { if (a <= 26){ if(c[i + 2]=='0') { out.print(L[c[i]-'0']); out.print(L[Integer.parseInt("" + c[i+1] + c[i + 2])]); break; } else{ out.print(L[a]); out.print(L[c[i +2] - '0']); break; } } else{ out.print(L[c[i]-'0']); } } else { if (a <= 26) { out.print(L[a]); i++; } else{ out.print(L[c[i] - '0']); if(i==c.length-2){ out.print(L[c[i+1]-'0']); break;} } } } out.flush(); } }
0.0分
1 人评分
剔除相关数 (C语言代码)浏览:1058 |
C语言训练-求1+2!+3!+...+N!的和 (C语言代码)浏览:575 |
C语言程序设计教程(第三版)课后习题6.4 (C语言代码)浏览:781 |
ASCII帮了大忙浏览:797 |
用筛法求之N内的素数。 (C语言代码)浏览:685 |
C语言程序设计教程(第三版)课后习题10.4 (C语言代码)浏览:583 |
1035 题解浏览:875 |
C二级辅导-统计字符 (C语言代码)浏览:514 |
2004年秋浙江省计算机等级考试二级C 编程题(1) (C语言代码)浏览:331 |
字符逆序 (C语言代码)浏览:675 |
一枚渣子 2023-01-17 20:33:09 |
感谢指正,已经调整代码了