编写程序求出555555的约数中最大的三位数是多少.

来源:学生作业帮助网 编辑:作业帮 时间:2024/04/30 04:17:22
编写程序求出555555的约数中最大的三位数是多少.

编写程序求出555555的约数中最大的三位数是多少.
编写程序求出555555的约数中最大的三位数是多少.

编写程序求出555555的约数中最大的三位数是多少.
#include
void main()
{
long i;
int j;
printf("Please input number:");
scanf("%ld",&i);
for(j=999;j>=100;j--)
if(i%j==0)
{
printf("The max factor with 3 digits in %ld is:%d,\n",i,j);
break;
}
}
*运行结果
输入:555555
输出:The max factor with 3 digits in 555555 is:777