#18388: 為啥RE


a43913072@gmail.com (陳芃)

學校 : 國立暨南國際大學
編號 : 86383
來源 : [219.68.215.178]
最後登入時間 :
2019-06-25 20:44:12
a020. 身分證檢驗 | From: [219.68.215.178] | 發表日期 : 2019-07-08 20:58

public class a59{
public static void main(String[] args) {
java.util.Scanner scanner = new java.util.Scanner(System.in);
String[] en={"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"};
int[] nu={10,11,12,13,14,15,16,17,34,18,19,20,21,22,35,23,24,25,26,27,28,29,32,30,31,33};
int sum=0;
for(int i=0;i<1;i++) {
String input=scanner.next();
for(int j=0;j<26;j++) {
if(input.equals(en[j])) {
sum=(nu[j]%10)*9+(nu[j]/10);
}
}
}
int[] num= {8,7,6,5,4,3,2,1,1};
for(int i=0;i<9;i++) {
int r=scanner.nextInt();
sum=sum+r*num[i];
}
if(sum%10==0) {
System.out.println("real");
}else {
System.out.println("fake");
}
}
}

 
ZeroJudge Forum