import java.util.Scanner;
public class Demo1{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.println("请输入一个整数或分数:");
double d = input.nextDouble();
int i = (int)d;
if (i==d) {
System.out.println("你输入的数是整数");
}else{
System.out.println("你输入的数是分数");
}
}
}
//你先看下代码,哪看不懂在追问我