Advertisement
Spocoman

04. Triangle of Dollars

Sep 13th, 2023
679
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.25 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.     int num;
  7.     cin >> num;
  8.  
  9.     for (int i = 1; i <= num; i++) {
  10.         for (int j = 0; j < i; j++) {
  11.             cout << "$ ";
  12.         }
  13.         cout << endl;
  14.     }
  15.     return 0;
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement