Cod sursa(job #2335268)

Utilizator liviu2000Dragomirescu Liviu liviu2000 Data 3 februarie 2019 20:53:19
Problema Bowling Scor 20
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.65 kb
#include <bits/stdc++.h>

using namespace std;

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

int main()
{
    int n  , i , j , k , p , x , ct;
    fin >> n ;
    for ( i = 1 ; i <= n ; i++ )
    {
        fin >> k ;
        ct=0;
        x=0;
        for ( j = 1 ; j <= k ; j++ )
        {
            fin >> p ;
            if ( p == 0 )
            {
                x = (x^(ct%3)) ;
                ct=0;
            }
            else
                ct++ ;
        }
        x = x^(ct%3) ;
        if ( x == 0 )
            fout << "Fumeanu" << '\n' ;
        else
            fout << "Nargy" << '\n' ;
    }
}