fork download
  1. /******************************************************************************
  2.  
  3. Welcome to GDB Online.
  4. GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
  5. C#, OCaml, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
  6. Code, Compile, Run and Debug online from anywhere in world.
  7.  
  8. *******************************************************************************/
  9. #include <iostream>
  10. using namespace std;
  11. int main()
  12. {
  13. int n;
  14. cout<<"Enter an odd number greater then 3: ";
  15. cin>>n;
  16. if(n%2==0 || n<=1){
  17. cout<<"plz write a odd number";
  18. return 0;
  19. }
  20. int mid=n/2;
  21. for(int i =0; i<n; i++){
  22. for(int j=0; j<n+2; j++ ){
  23. cout<<"*";
  24. }
  25.  
  26. if( i== mid ){
  27. cout<<" ";
  28. for(int j=0; j<n+2; j++){
  29. cout<<"e";
  30. }
  31. }
  32.  
  33. cout<<endl;
  34.  
  35. }
  36. for(int i=0;i<n+2; i++){
  37.  
  38. for(int j=0; j<mid+1; j++){
  39. cout<<" ";
  40. }
  41. cout<<"e";
  42. cout<<endl;
  43. }
  44.  
  45.  
  46. return 0;
  47. }
Success #stdin #stdout 0s 5316KB
stdin
11
stdout
Enter an odd number greater then 3: *************
*************
*************
*************
*************
************* eeeeeeeeeeeee
*************
*************
*************
*************
*************
      e
      e
      e
      e
      e
      e
      e
      e
      e
      e
      e
      e
      e