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 i,j;
  13. for(i=1;i<=10;i++)
  14. {
  15. System.out.println("3x"+i+"="+(3*i));
  16. }
  17.  
  18.  
  19.  
  20. for( i=10; i>0 ;i--){
  21. for( j=0;j<i;j++){
  22. System.out.print(" ");
  23. }
  24. if(i==10)
  25. System.out.print("*");
  26. for(j=i ;j<10 ;j++){
  27. System.out.print("*");
  28. }
  29. for(j=i ;j<10 ;j++){
  30. System.out.print("*");
  31. }
  32. System.out.print("\n");
  33.  
  34. }
  35. for( i=0; i<11 ;i++){
  36. for( j=0;j<i;j++){
  37. System.out.print(" ");
  38. }
  39. if(i==10){
  40. System.out.print("*");
  41. break;
  42. }
  43. for(j=i ;j<10 ;j++){
  44. System.out.print("*");
  45. }
  46. for(j=i ;j<10 ;j++){
  47. System.out.print("*");
  48. }
  49. System.out.print("\n");
  50.  
  51. }
  52.  
  53.  
  54.  
  55. }
  56. }
Success #stdin #stdout 0.07s 380160KB
stdin
Standard input is empty
stdout
3x1=3
3x2=6
3x3=9
3x4=12
3x5=15
3x6=18
3x7=21
3x8=24
3x9=27
3x10=30
          *
         **
        ****
       ******
      ********
     **********
    ************
   **************
  ****************
 ******************
********************
 ******************
  ****************
   **************
    ************
     **********
      ********
       ******
        ****
         **
          *