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.  
  13. // your code goes here
  14. int n=8;
  15. for(int i=1;i<=n;i++)
  16. {
  17. char ch=(char) ('H'-i+1);
  18. for(int j=1;j<=i;j++)
  19. {
  20. System.out.print(ch+" ");
  21. ch++;
  22. }
  23. System.out.println();
  24. }
  25. }
  26. }
Success #stdin #stdout 0.15s 55636KB
stdin
Standard input is empty
stdout
H 
G H 
F G H 
E F G H 
D E F G H 
C D E F G H 
B C D E F G H 
A B C D E F G H