Advertisement
PiotrJurek

Zad3

May 30th, 2020
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.48 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <iomanip>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.     ofstream plik("mnozenie.txt");
  10.     if(plik.is_open())
  11.     {
  12.             for(int i=1; i<=10; i++)
  13.         {
  14.             for(int j=1; j<=10; j++)
  15.             {
  16.                 plik << setw(3) << i*j << " ";
  17.             }
  18.             plik << endl;
  19.         }
  20.     }
  21.     else
  22.     {
  23.         cout << "Zapis nieudany. Konczenie programu.";
  24.     }
  25.     plik.close();
  26.     return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement