fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n;
  6. cin >> n;
  7.  
  8. for (int i = 1; i <= n; i++) {
  9.  
  10. // Print spaces
  11. for (int j = 1; j <= n - i; j++) {
  12. cout << " ";
  13. }
  14.  
  15.  
  16. for (int j = 1; j <= i; j++) {
  17. cout << "o";
  18. }
  19.  
  20.  
  21. }
  22.  
  23. return 0;
  24. }
Success #stdin #stdout 0s 5324KB
stdin
4
4
stdout
   o  oo ooooooo