Cod sursa(job #734133)

Utilizator alex_unixPetenchea Alexandru alex_unix Data 13 aprilie 2012 17:22:28
Problema Fructe Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.38 kb

#include <fstream>

int main (void)
{
    unsigned short t;
    unsigned int a;
    char trash [10];
    std::ifstream input("fructe.in");
    input >> t;
    std::ofstream output("fructe.out");
    do
    {
        input >> trash >> a;
        output << (a % 2 ? '1' : '0') << ' ';
        --t;
    }
    while (t);
    input.close();
    output << '\n';
    output.close();
    return 0;
}