void toScreen(ifstream& ifs)
{
        int n;
        while(!ifs.eof())
        {
                cout<<n<<endl;
                ifs>>n;
        }
}

int main()
{
        ifstream ifs;
        ifs.open("aaaa.txt");
        if(ifs.fail())
        {
                cout<<"error"<<endl;
                exit(1);
        }
        toScreen(ifs);
        ifs.close();
        return 0;
}