Advertisement
Guest User

Untitled

a guest
Apr 7th, 2020
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <stdio.h> // подключаем функции дл работы с файлами
  4. #include <conio.h> // подключам getch
  5. #include <cmath>
  6. #include <string>
  7. using namespace std;
  8.  
  9. int main(int argc, char* argv[])
  10. {
  11.     setlocale(LC_ALL, "rus");
  12.     ifstream f1;
  13.     ofstream f;
  14.     int n;
  15.     cout << "Введите кол-во степеней тройки которые надо вывести на экран:";
  16.     cin >> n;
  17.     f.open("output.dat", ios::binary);
  18.     int x = 3;
  19.     for (int i = 0; i < n; i++)
  20.     {
  21.         f.write((char*)(&x), sizeof(x));
  22.         x *= x;
  23.     }
  24.     f.close();
  25.     f1.open("output.dat", ios::binary);
  26.     while()
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement