fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4.  
  5.  
  6.  
  7. int main(){
  8. for(int r = 1; r <= 5; r++){
  9. for(int c = 1; c <= 2*r -1; c++)
  10. cout << "*";
  11. cout<< endl;
  12. }
  13. for(int r1 = 5; r1 >= 1; r1--){
  14. for(int c1 = 1; c1 <= 2*r1 -1; c1++)
  15. cout << "*";
  16. cout<< endl;
  17. }
  18. return 0;
  19. }
Success #stdin #stdout 0s 3340KB
stdin
Standard input is empty
stdout
*
***
*****
*******
*********
*********
*******
*****
***
*