#include<stdio.h> int func(int n) { int max = 0; for (int i = 999; i >= 100; i--) { if (n % i == 0) { return i; } } return 0; } int main() { int n = 0; printf("请输入整数n:>"); scanf("%d", &n); if (1000 <= n && 1000000 >= n) { int ret = func(n); if (ret != 0) { printf("n的最大三位约数为%d", ret); } else { printf("n没有三位约数"); } } else { printf("Input error"); } return 0; }
03-31
636
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
02-21
2013
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)