fojtasd

Untitled

Mar 30th, 2019
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3.  
  4. using namespace std;
  5.  
  6.  
  7.  
  8.  
  9. int main() {
  10.     ofstream myfile;
  11.     int input;
  12.     char text = ' ';
  13.    
  14.     myfile.open("pi.txt");
  15.     cout << "Zadej pocet desetinnych mist pro zobrazeni iracionalniho cisla pi: ";
  16.     cin >> input;
  17.     cout << endl << "3,";
  18.     for (int i = 0; i < input; i++)
  19.     {
  20.         myfile >> text;
  21.         cout << text;
  22.     }  
  23.     cout << endl;
  24.  
  25.  
  26.  
  27.  
  28.  
  29.     system("pause");
  30.     return 1;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment