csansoon

P3.13 P87323 Rectangles diagonals

Oct 10th, 2018
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main(){
  5.  
  6.     int x,z;
  7.     int i=0;
  8.     cin >> x >> z;
  9.  
  10.     for (int row=0;row<x;++row){
  11.         for (int column=0;column<z;++column){
  12.             if (column<=i){
  13.                 cout << (i-column)%10;
  14.             }
  15.             else{
  16.                 cout << (column-i)%10;
  17.             }
  18.         }
  19.         ++i;
  20.         cout << endl;
  21.     }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment