Cod sursa(job #2594589)

Utilizator Cezar211Popoveniuc Cezar Cezar211 Data 6 aprilie 2020 13:27:26
Problema Bowling Scor 20
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.53 kb
#include <bits/stdc++.h>
using namespace std;
ifstream fin ("bowling.in");
ofstream fout ("bowling.out");
int T, n, x;
int main()
{
    fin >> T;
    while(T--)
    {
        fin >> n;
        int rez = 0, s = 0;
        for(int i=1; i<=n; i++)
        {
            fin >> x;
            if(x == 0)
                rez^=(s%3), s = 0;
            else
                s++;
        }
        rez^=(s%3);
        if(rez)
            fout << "Nargy\n";
        else
            fout << "Fumeanu\n";
    }
    return 0;
}