Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- #include <limits> // только для второго задания
- // 1
- // ...
- float buff = 0;
- std::ifstream fin("f");
- while (!fin.eof()) fin >> buff;
- fin.close();
- std::ofstream fout("f1");
- fout << buff;
- fout.close();
- // ...
- // 2
- // ...
- float buff = 0, maxfloat = std::numeric_limits<float>::min();
- std::ifstream fin("f");
- while (!fin.eof())
- {
- fin >> buff;
- maxfloat = (maxfloat < buff ? buff : maxfloat);
- }
- fin.close();
- std::ofstream fout("f1");
- fout << maxfloat;
- fout.close();
- // ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement