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