import java.util.*;
public class HomeWork0608 {
public static void main(String[] args){
Scanner sc=new
Scanner(System.in);
int []envoice={3,5,18,28,33,40};//事先排好中獎號碼
int []check=new int[6];
for(int j=0;j<6;j++){
check[j]=sc.nextInt();
}
for (int i=0;i<check.length-1;i++){
for (int j = 0; j < check.length-1-i; j++){
if(check[j]>check[j+1]){
check[j]=check[j]^check[j+1];
check[j+1]=check[j]^check[j+1];
check[j]=check[j]^check[j+1];
}//使用XOR交換,未使用到變數儲存變數
}
}
//輸入內容,並以氣泡法排序
for(int t=0;t<6;t++){
if(check[t]!=envoice[t]){
System.out.print("未中獎");
break;
}
else
System.out.print("恭喜中獎");
break;
}//開始查詢是否中獎
sc.close();
}
}
沒有留言:
張貼留言