#include <iostream>
#include <fstream>
#include <cstdlib>
#include <conio.h>
using namespace std;
int main()
{
fstream plik;
plik.open("liczby.txt");
string str;
int najwieksza=0;
while(true)
{
plik >> str;
int x = atoi(str.c_str());
if(najwieksza<x)
najwieksza = x;
if(plik.fail())
break;
}
cout << "Najwieksza to: " << najwieksza << endl;
plik.close();
return 0;
}
Paste Hosted With By Wklejamy.pl