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

2 years ago
#include <bits/stdc++.h>
using namespace std;
int main() {
2 years ago
// 讨论F(i)与f(i)的所有因子之间的关联关系
2 years ago
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;
}