csansoon

P3.10 X26853 Rectangles (1)

Oct 3rd, 2018
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.     int n, m, s;
  6.     cin >> n >> m;
  7.     s = ((n+m)%5);
  8.     while (n>0) {
  9.         for (int m2=m; m2>0; m2--) {
  10.             cout << s;
  11.         }
  12.         cout << endl;
  13.         n--;
  14.     }
  15.     while (cin >> n >> m) {
  16.         s = ((n+m)%5);
  17.         cout << endl;
  18.         while (n>0) {
  19.             for (int m2=m; m2>0; m2--) {
  20.                 cout << s;
  21.             }
  22.             cout << endl;
  23.             n--;
  24.         }
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment