Advertisement
adambkehl

Assignment #2 (1/2) - Page 252 #10

Feb 22nd, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5.     int rows = 0, count = 0;
  6.     cout << "Enter number of rows: ";
  7.     cin >> rows;
  8.     count = rows;
  9.  
  10.     for (int i = 0; i < rows; i++) {
  11.         count--;
  12.         for (int j = count; j > 0; j--) cout << ".";
  13.         for (int k = rows - count; k > 0; k--) cout << "#";
  14.         cout << endl;
  15.     }
  16.  
  17.     cin.get(), cin.get();
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement