fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. int n;
  7. cout<<"enter the value of n=";
  8. cin>>n;
  9. if(n%2==0||n==1||n<0){
  10. return 0;
  11. }
  12. for(int i=0;i<n+2;i++){
  13. for(int j=0;j<((n+2)+(n/2));j++){
  14. cout<<" ";
  15. }
  16. cout<<"e";
  17. cout<<endl;
  18. }
  19. for(int i=0;i<n+2;i++){
  20. for(int j=0;j<n+2;j++){
  21. if(i==(n/2)+1){
  22. cout<<"e";
  23. }
  24. else{
  25. cout<<" ";
  26. }
  27. }
  28. for(int k=0;k<n;k++){
  29. cout<<"*";
  30. }
  31. cout<<endl;
  32. }
  33. return 0;
  34. }
Success #stdin #stdout 0.01s 5328KB
stdin
3
stdout
enter the value of n=      e
      e
      e
      e
      e
     ***
     ***
eeeee***
     ***
     ***