1 ImportJava.util.Scanner;2 3 Public classdayin_100 {4 Public Static voidMain (string[] args) {5System.out.println ("Enter the first number of integers you want to print:");6Scanner San1 =NewScanner (system.in);7System.out.println ("Please enter the mantissa of the integer to be printed:");8Scanner San =NewScanner (system.in);9 intNUM1 =San1. Nextint ();Ten intNum =San. Nextint (); One Dayin (num1,num); A } - Public Static voidDayin (intSUM1,intSUM) {//Packaging Printing Methods - intx = 0; the for(intI =sum1; I <= sum; i++) { - intA= i%10;//determine if the digits have a number 9 - intB= i/10%10;//determine if 10 digits have a number 9 - intC= i/10/10%10;//determine if the hundred have a number 9 + if(a!=9 && b!=9 && c!=9) {//when none of them contain 9 o'clock, go to print -System.out.print (i+ "\ T"); +x + +;//records an index value when the index is wrapped every 5 o'clock A if(x%5==0){ at System.out.println (); - } - } - } - } -}
The output is:
Please enter the first number of integers to be printed: 5
Please enter the mantissa of the integer to be printed: 50
5 6 7) 8 10
1112131415
1617182021
2223242526
2728303132
3334353637
3840414243
4445464748
50
Java_ prints an integer from one count to another, and every 5 is a line