Advertisement
Guest User

Untitled

a guest
Feb 18th, 2020
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. /*
  2. //файлы 4.7
  3. #include <iostream>
  4. #include <fstream>
  5. using namespace std;
  6. int main() {
  7. setlocale(LC_ALL, "rus");
  8. ofstream a("input.dat", ios::binary);
  9. int b, c, n;
  10. cout << "Введите кол-во чисел и диапазон\n";
  11. cin >> n >> b >> c;
  12. for (int i = 0; i < n; ++i) {
  13. int ch;
  14. cin >> ch;
  15. a.write((char*)&ch, sizeof(int));
  16. }
  17. a.close();
  18. ifstream aa("input.dat", ios::binary);
  19. int ch;
  20. while (aa.read((char*)&ch, sizeof(int))) {
  21. if (ch >= b && ch <= c)
  22. cout<<ch<<" ";
  23. }
  24. aa.close();
  25. }
  26. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement