JAVA - a for loop to achieve 99 multiplication table


TEST03 {class public
public static void main (String [] args) {
 int = Lie. 1;
 for (int. 1 = Hang; Hang <=. 9;) {
  of System.out.print (Lie + "*" + Hang + "=" + Hang * + Lie "\ T");
// the value when the column is greater than or equal then the process line feed, and then reset the value of the column 1, let the value of the row is incremented
  iF (Lie> = Hang) {
   the System. Out.println ();
   Lie =. 1;
   Hang ++;
  }
// only those values for otherwise self-energizing and not wrap
  the else {
   Lie ++;
  }
 }
}

}

 

 

The following is a screenshot of the result:

Guess you like

Origin www.cnblogs.com/yhx0921/p/11482886.html
Recommended