Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
大牛们帮忙看看,一直WA,谢谢!import java.util.Scanner; class Main{ public static void main(String[] args) { Scanner scanner=new Scanner(System.in); String encrypting=scanner.next(); String original=scanner.next(); String temp="";char[] tem; int length=original.length(); char[]ori=original.toCharArray(); char[]enc=encrypting.toCharArray(); for(int i=0;i<length;i++) {if(ori[i]!='Z'){ori[i]=++ori[i];temp+=ori[i];} else temp+='A';} tem=temp.toCharArray(); java.util.Arrays.sort(tem); java.util.Arrays.sort(enc); int work=1; for(int h=0;h<length;h++)if(tem[h]!=enc[h]){work=0;break;} if(work==1)System.out.println("YES");else System.out.println("NO"); } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator