Pagini recente » Cod sursa (job #413512) | Cod sursa (job #2025714) | Cod sursa (job #418719) | Cod sursa (job #1771283) | Cod sursa (job #743056)
Cod sursa(job #743056)
#include <fstream>
using namespace std;
const int N = 20005;
char s[N];
ifstream in("xerox.in");
ofstream out("xerox.out");
inline bool cifra(char& c)
{
return '0' <= c && c <= '9';
}
void get(int& x)
{
int p = 0;
in.getline(s, N);
while (!cifra(s[p]))
p++;
x = 0;
while (cifra(s[p]))
x = x * 10 + s[p++] - '0';
}
bool work()
{
int n, sum = 0, x;
get(n);
while (n--)
{
get(x);
sum ^= x;
}
return sum != 0;
}
int main()
{
int t;
in >> t >> ws;
while (t--)
out << work() << "\n";
return 0;
}