只出现一次的数字_#include

#include<iostream>
using namespace std;
#include <vector>

int main() {
vector <int> nums;
int number;
while (1) {
cin >> number;
nums.push_back(number);
if (cin.get() == '\n') {
break;
}
}
int ans = 0;
for (int i = 0; i < nums.size(); i++) {
ans ^= nums[i];
}
cout << ans << endl;
return 0;
}