Advertisement
Spocoman

03. Square of Stars

Sep 13th, 2023 (edited)
780
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.47 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.     int num;
  7.     cin >> num;
  8.  
  9.     for (int i = 0; i < num; i++) {
  10.         for (int j = 0; j < num; j++) {
  11.             cout << "* ";
  12.         }
  13.         cout << endl;
  14.     }
  15.     return 0;
  16. }
  17.  
  18. Или тарикатската:)
  19.  
  20. #include <iostream>
  21.  
  22. using namespace std;
  23.  
  24. int main() {
  25.     int num;
  26.     cin >> num;
  27.  
  28.     for (int i = 0; i < num; i++) {
  29.         cout << string(num, '*') << endl;
  30.     }
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement