HDOJ 1563 Find your present!

来源:互联网 发布:好医生app软件 编辑:程序博客网 时间:2024/06/05 08:44

HDACM 1563

异或的运用
同2095

import java.util.Scanner;public class Main{    public static void main(String[] args) {        Scanner sc = new Scanner(System.in);        while (sc.hasNext()) {            int n = sc.nextInt();            if (n==0) {                break;            }            int num = sc.nextInt();            n--;            while (n-->0) {                num = num^sc.nextInt();            }            System.out.println(num);        }        sc.close();    }}
原创粉丝点击