This commit is contained in:
HuangHai
2025-08-30 18:35:01 +08:00
commit 1f397eca87
6258 changed files with 1487241 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
#include <iostream>
using namespace std;
int n, cnt;
int f(int n) {
if (n == 2)
cnt = 2;
else if (n == 4)
cnt = 4;
else if (n == 5)
cnt = 3;
else if (n == 7)
cnt = 3;
else if (n % 3 == 0)
cnt = n / 3;
else if (n % 3 == 1)
cnt = (n - 7) / 3 + 3;
else if (n % 3 == 2)
cnt = (n - 5) / 3 + 3;
return cnt;
}
int main() {
for (int i = 2; i <= 100; i++)
cout << "i=" << i << ",fan=" << f(i) << endl;
return 0;
}