fork download
  1.  
  2. #include <iostream>
  3. using namespace std;
  4.  
  5. void solve(int n){
  6. for(int i=1;i<=n+2;i++){
  7. for(int j=1;j<=n-1;j++){
  8. if(i==n+2) {
  9. cout<<"*";
  10. }
  11. else{
  12. cout<<" ";
  13. }
  14. }
  15. for(int j=0;j<1;j++){
  16. cout<<"e";
  17. }
  18. for(int j=0;j<n+2;j++){
  19. if(i==1){
  20. cout<<"*";
  21. }
  22. }
  23. for(int j=0;j<n;j++){
  24. if(i==(n+2)/2+1){
  25. cout<<"*";
  26. }
  27. }
  28. cout<<endl;
  29. }
  30. }
  31.  
  32. int main()
  33. {
  34. int n;
  35. cin>>n;
  36.  
  37. if(n<3 || n%2==0){
  38. cout<<"Not Valid";
  39. }else{
  40. solve(n);
  41. }
  42.  
  43.  
  44. return 0;
  45. }
Success #stdin #stdout 0.01s 5320KB
stdin
Standard input is empty
stdout
Not Valid