稍微改了下,这样不会无限循环.....
//created by INSANEFORM
public class ComputingFractions
{
public static void main(String[] args)
{
int num1=1;
int num2=10;
int num11=num1;
int den1=1;
int den2=10;
int den11=den1;
while (num11<=num2)
{
num11++;
while (den11<=den2)
{
den11++;
if (((num11/den11)*den11 !=num11)
XXXXXXXXXXXXXintln(num11 +" is not represented precisely");
}
}
}
}
但是有一点要LZ注意....两个整形相除的结果不是小数,而是整数....小数部分会被舍弃。