You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
576 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#include <bits/stdc++.h>
using namespace std;
int main() {
// 讨论F(i)与f(i)的所有因子之间的关联关系
int n = 100;
for (int i = 1; i <= n; i++) {
printf("F(%d)=", i);
bool f = 1;
for (int j = 1; j <= n; j++) {
if (i % j == 0) { // 如果j是i的因子的话输出f(j)
if (f) {
printf("f(%d)", j);
f = 0;
} else
printf("+f(%d)", j);
}
}
printf("\n");
}
return 0;
}