参考代码:
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); char []a = scanner.nextLine().toCharArray(); char []b = scanner.nextLine().toCharArray(); char []c = scanner.nextLine().toCharArray(); char []e = new char[26]; for(int i = 0; i < a.length; i++) { if(e[a[i] - 'A'] == 0) e[a[i] - 'A'] = b[i]; else if(e[a[i] - 'A'] != b[i]) { System.out.print("Failed"); return; } } for(char x: e) if(x == 0) { System.out.print("Failed"); return; } for(int i = 0; i < c.length; i++) { System.out.print(e[c[i] - 'A']); } } }
0.0分
4 人评分
C语言程序设计教程(第三版)课后习题1.5 (C语言代码)浏览:592 |
川哥的吩咐 (C语言代码)浏览:611 |
C语言训练-8除不尽的数 (C语言代码)浏览:1402 |
小O的乘积 (C语言代码)浏览:1014 |
1199题解浏览:656 |
C语言程序设计教程(第三版)课后习题6.7 (C++代码)浏览:588 |
核桃的数量 (C语言代码)浏览:829 |
拯救雅典娜浏览:1241 |
C语言训练-求PI* (C语言代码)浏览:512 |
A+B for Input-Output Practice (C语言代码)浏览:472 |