【思路】:就是一个判断整除的问题。
【AC代码】:
#include <iostream> #include <algorithm> #include <string> #include <cstdio> #include <cstring> using namespace std; int main() { //freopen("in.txt", "r", stdin); int n = 0, i = 0; cin >> n; for (i = 1; i <= n; i++) { double div = n*1.0 / i; if ((div - (int)div) < 0.00001) { cout << i << " * " << div << " = " << n << endl; } } return 0; }
原文地址:http://blog.csdn.net/weijj6608/article/details/44761153