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