wiktormadera

zad12

Apr 2nd, 2020
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. void KWADRAT(int n)
  6. {
  7.     for(int i=1; i<=n; i++)
  8.     {
  9.     for(int i=1; i<=n; i++)
  10.     {
  11.         cout << "*";
  12.     }
  13.     cout << endl;
  14.     }
  15. }
  16.  
  17. int main()
  18. {
  19.    int n;
  20.     cout << "Podaj liczbe naturalna: " << endl;
  21.     cin >> n;
  22.     if (n<1)
  23.     {
  24.         cout << "NieprawidÅ‚owa liczba.";
  25.     }
  26.     else
  27.     {
  28.         KWADRAT(n);
  29.     }
  30.     return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment