csansoon

P3.11 X59091 Rectangles (2)

Oct 3rd, 2018
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.58 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 = 9;
  8.     while (n>0) {
  9.        
  10.         for (int m2=m; m2>0; m2--) {
  11.             cout << s;
  12.             s--;
  13.             if (s<0) s=9;
  14.         }
  15.         cout << endl;
  16.         n--;
  17.     }
  18.     while (cin >> n >> m) {
  19.         s = 9;
  20.         cout << endl;
  21.         while (n>0) {
  22.             for (int m2=m; m2>0; m2--) {
  23.                 cout << s;
  24.                 s--;
  25.                 if (s<0) s=9;
  26.             }
  27.             cout << endl;
  28.             n--;
  29.         }
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment