Jump to content

Recommended Posts

  • Moderators
Posted

Hmm, poţi citit până ajungi la final, gen

#include <iostream>
#include <fstream>

using namespace std;

ifstream fin("intrare.txt");

int main()
{
    int numar;

    while( !fin.eof() ) { // cat timp nu am ajuns la sfarsitul fisierului
        fin >> numar;   // citim cate un numar din el
    }

    cout << numar;
    return 0;
}

 

  • gaby changed the title to Determinarea ultimului numar dintr-un fisier?

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.