以下是引用ww84020209在2006-9-27 21:43:54的发言:
for(i=1;i<=sqrt(120);i++)
{
if(120%i==0 && 667%(i+120/i)==0)
printf("the two numbers are %d,%d\n",i*667/(i+120/i),120/i*667/(i+120/i));
}
能不能给一些提示?
方法2:
#include<stdio.h>
#include<math.h>
int main()
{
int i;
for(i=1;i<=sqrt(120);i++)
{
if(120%i==0 && 667%(i+120/i)==0)
printf("the two numbers are %d,%d\n",i*667/(i+120/i),120/i*667/(i+120/i));
}
}
for(i=1;i<=sqrt(120);i++)
{
if(120%i==0 && 667%(i+120/i)==0)
printf("the two numbers are %d,%d\n",i*667/(i+120/i),120/i*667/(i+120/i));
}
能不能给一些提示?
♂ 死后定当长眠,生前何须久睡。♀