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. class Ideone {
  8.  
  9. public static void main (String[] args) throws java.lang.Exception
  10. {
  11. int n = 3;
  12.  
  13. printCustomPattern(n);
  14. }
  15.  
  16. public static void printCustomPattern(int n) {
  17.  
  18. for (int i = 1; i <= n; i++) {
  19. for (int j = 1; j <= n*2; j++) {
  20. if (j == n*2-1) {
  21. System.out.print("e");
  22. } else {
  23. System.out.print("g");
  24. }
  25. }
  26. System.out.println();
  27. }
  28.  
  29.  
  30. for (int i = 1; i <= 2; i++) {
  31. for (int j = 1; j <= 5; j++) {
  32. System.out.print("*");
  33. }
  34. System.out.println();
  35. }
  36. }
  37. }
Success #stdin #stdout 0.08s 54712KB
stdin
Standard input is empty
stdout
ggggeg
ggggeg
ggggeg
*****
*****