import java.util.Scanner;
public class Frogs {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("please input the K and then press \"Enter\"");
int k = sc.nextInt();
System.out.println("please input the S and then press \"Enter\"");
int s = sc.nextInt();
printFrogs(k, s);
sc.close();
}
public static void printFrogs(int k,int s){
for(;k<=s;k++){
System.out.print(k+" frog has "+k+" mouth,"+k*2+" eyes and "+k*4+" legs,");
System.out.println("jump into the water with splash splash.");
}
}
}
修改了下,你可以自己输入S和K