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