fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. int n=-11;
  13. if(n%2==0)
  14. {
  15. System.out.println("Please Enter valid Input");
  16. }
  17. else{
  18. for(int i=1;i<=n;i++)
  19. {
  20. System.out.print("*");
  21. }
  22. System.out.println();
  23. for(int i=1;i<=(n+2);i++)
  24. {
  25. for(int j=1;j<=(n/2);j++)
  26. {
  27. System.out.print(" ");
  28. }
  29. for(int j=(n-3);j>=(n-3);j--)
  30. {
  31. System.out.print("e");
  32. }
  33. for(int j=(n-4);j<=n;j++)
  34. {
  35. System.out.print(" ");
  36. }
  37.  
  38. System.out.println();
  39. }
  40. for(int i=0;i<=(n-2);i++)
  41. {
  42. for(int j=1;j<=(i);j++)
  43. {
  44. System.out.print(" ");
  45. }
  46. for(int k=n;k>(i*2);k--)
  47. {
  48. System.out.print("*");
  49. }
  50. System.out.println();
  51. }
  52. }
  53.  
  54. }
  55. }
Success #stdin #stdout 0.09s 52664KB
stdin
8
stdout