Sicily 1200. Stick

来源:互联网 发布:插画比赛 知乎 编辑:程序博客网 时间:2024/06/05 10:20
// a ^ (b ^ b) ^ (c ^ c) ^ ... ^ (n ^ n) = a#include <iostream>using namespace std;int main(int argc, char **argv) {int n;while (cin >> n && n) {int res, tmp, nt = n - 1;cin >> res;while (nt--) {cin >> tmp;res ^= tmp;}cout << res << endl;}return 0;}

0 0
原创粉丝点击