Cod sursa(job #2691317)

Utilizator davidcotigacotiga david davidcotiga Data 28 decembrie 2020 11:43:31
Problema Jocul NIM Scor 100
Compilator cpp-64 Status done
Runda Arhiva educationala Marime 0.31 kb
#include <fstream>

using namespace std;

ifstream fin("nim.in");
ofstream fout("nim.out");

int main() {

	int t, n, nr, x;
	fin >> t;

	while (t--) {

		fin >> n;
		x = 0;

		for (int i = 0; i < n; i++) {
			fin >> nr;
			x ^= nr;
		}

		fout << (x == 0 ? "NU" : "DA") << '\n';
	}

	return 0;
}