AlexandruT

clasic - infoarena.ro

Jan 27th, 2016
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. #include <fstream>
  2.  
  3. using namespace std;
  4.  
  5. ifstream fin("clasic.in");
  6. ofstream fout("clasic.out");
  7.  
  8. int main()
  9. {
  10.     int i, j, t, n;
  11.     long long nr, sol;
  12.     fin >> t;
  13.     for(i = 1; i <= t; i++)
  14.     {
  15.         fin >> n;
  16.         sol = 0;
  17.         for(j = 1; j <= n; j++)
  18.         {
  19.             fin >> nr;
  20.             sol ^= nr;
  21.         }
  22.         fout << sol << "\n";
  23.     }
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment