Advertisement
Spocoman

02. Rectangle of N x N Stars

Sep 13th, 2023
788
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.  
  3. using namespace std;
  4.  
  5. int main() {
  6.     int side;
  7.     cin >> side;
  8.  
  9.     for (int i = 0; i < side; i++) {
  10.         for (int j = 0; j < side; 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 side;
  26.     cin >> side;
  27.  
  28.     for (int i = 0; i < side; i++) {
  29.         cout << string(side, '*') << endl;
  30.     }
  31.     return 0;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement