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. // // your code goes here
  13. // }
  14. // }
  15.  
  16. /* package whatever; // don't place package name! */
  17.  
  18. import java.util.*;
  19. import java.lang.*;
  20. import java.io.*;
  21.  
  22. /* Name of the class has to be "Main" only if the class is public. */
  23. class Ideone
  24. {
  25. public static void main (String[] args) throws java.lang.Exception
  26. {
  27. int n=-11;
  28. if(n%2==0)
  29. {
  30. System.out.println("Please Enter valid Input");
  31. }
  32. else{
  33. for(int i=1;i<=n;i++)
  34. {
  35. System.out.print("*");
  36. }
  37. System.out.println();
  38. for(int i=1;i<=(n+2);i++)
  39. {
  40. for(int j=1;j<=(n/2);j++)
  41. {
  42. System.out.print(" ");
  43. }
  44. for(int j=(n-3);j>=(n-3);j--)
  45. {
  46. System.out.print("e");
  47. }
  48. for(int j=(n-4);j<=n;j++)
  49. {
  50. System.out.print(" ");
  51. }
  52.  
  53. System.out.println();
  54. }
  55. for(int i=0;i<=(n-2);i++)
  56. {
  57. for(int j=1;j<=(i);j++)
  58. {
  59. System.out.print(" ");
  60. }
  61. for(int k=n;k>(i*2);k--)
  62. {
  63. System.out.print("*");
  64. }
  65. System.out.println();
  66. }
  67. }
  68.  
  69. }
  70. }
Success #stdin #stdout 0.07s 54628KB
stdin
Standard input is empty
stdout