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. int i, j, n;
  15. Scanner sc = new Scanner(System.in);
  16. n = 5;
  17. if(n<0 || n==1){
  18. System.out.print("Blank");
  19. }
  20. if(n%2==0){
  21. System.out.print("Blank");
  22. }
  23. for(i=0; i<n/2-1; i++){
  24. for(j=0; j<n+2; j++){
  25. if(j==0 || i==0){
  26. System.out.print("e");
  27. }
  28. else
  29. System.out.print(" ");
  30. }
  31.  
  32. }
  33. for(i=0; i<n/2+1; i++){
  34. for(j=0; j<(n/2+1)-i; j++) {
  35. System.out.print(" ");
  36. }
  37. for(j=0; j<2*i+1; j++) {
  38. System.out.print("*");
  39. }
  40. System.out.println();
  41. }
  42. }
  43. }
Success #stdin #stdout 0.17s 56636KB
stdin
Standard input is empty
stdout
eeeeeee   *
  ***
 *****