参考代码:
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语言训练-求矩阵的两对角线上的元素之和 (C语言代码)浏览:619 |
蓝桥杯历届试题-九宫重排 (C++代码)浏览:2812 |
C语言训练-计算:t=1-1/(2*2)-1/(3*3)-...-1/(m*m) (C语言代码)浏览:799 |
【数组的距离】 (C语言代码)浏览:787 |
C语言程序设计教程(第三版)课后习题6.1 (C语言代码)浏览:700 |
A+B for Input-Output Practice (III) (C语言代码)浏览:592 |
简单的a+b (C语言代码)浏览:878 |
Hello, world! (C++代码)浏览:1778 |
a+b浏览:452 |
1011题解浏览:819 |