publicclassTest0206062{publicstaticvoidmain(String[] args){
java.util.Scanner s =newjava.util.Scanner(System.in);
System.out.print("请输入结果条数:");int n = s.nextInt();
System.out.print("请输入单页显示条数:");int m = s.nextInt();
System.out.print("请输入要查询页数:");int i = s.nextInt();if(n >0& m >0& n >= m & i >=1& i<= n / m +1){if(n == m & i >1){
System.out.println("您的输入有误");}int a =(i -1)* m +1;int b = i * m;;if(i ==(n / m)+1& n != m){
b = n;}
System.out.println("第"+ i +"页显示第"+ a +"条到第"+ b +"条");}else{
System.out.println("您的输入有误");}}}
(if语句)某项查询之后,n条结果,单页显示m条记录,第i页显示第几条到第几条?public class Test0206062{ public static void main(String[] args){ java.util.Scanner s = new java.util.Scanner(System.in); System.out.print("请输入结果条数:"); ...