fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n;
  6. cin >> n;
  7. for(int i=n;i>=1;i-=2){
  8. for(int j=1;j<=i-1;j+=2){
  9. cout << " ";
  10. }for (int k=i;k<=n;k++){
  11. cout << "o";
  12. }
  13. cout << "\n";
  14. }
  15. return 0;
  16. }
  17.  
Success #stdin #stdout 0.01s 5304KB
stdin
5
stdout
  o
 ooo
ooooo