From a2ce73c6b6cc9883b5886f9f1f2d2e0900b37e10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E6=B5=B7?= <10402852@qq.com> Date: Sat, 16 Dec 2023 09:16:46 +0800 Subject: [PATCH] 'commit' --- TangDou/Topic/mobius_Prepare.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 TangDou/Topic/mobius_Prepare.cpp diff --git a/TangDou/Topic/mobius_Prepare.cpp b/TangDou/Topic/mobius_Prepare.cpp new file mode 100644 index 0000000..129277d --- /dev/null +++ b/TangDou/Topic/mobius_Prepare.cpp @@ -0,0 +1,20 @@ +#include +using namespace std; +int main() { + 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; +} \ No newline at end of file