fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. int row=7;
  7. for(int i=1;i<=row;i++){
  8. if(row<(row+1)/2){
  9. cout<<"*";
  10. for(int j=1;j<=((row-1)/2)-1;j++){
  11. cout<<" ";
  12. }
  13. cout<<"*";
  14. if(i==1){
  15. for(int j=1;j<=(row-1)/2;j++){
  16. cout<<"*";
  17. }
  18. cout<<"endl";
  19. }
  20. }
  21.  
  22.  
  23.  
  24. }
  25. return 0;
  26. }
Success #stdin #stdout 0.01s 5320KB
stdin
Standard input is empty
stdout
Standard output is empty