- C24zhouyanchen's blog
筛
- @ 2024-11-26 20:19:01
#include <cmath>
#include <iomanip>
#include <iostream>
using namespace std;
int main(){
long double n;
cout << "请输入n:";
cin >> n;
if (n <= 0){
cout << "sb";
return 0;
}
cout << "欧拉筛:" << fixed << n << '\n';
if (n <= 2){
cout << "埃氏筛:" << fixed << n << '\n';
cout << "朴素筛:" << fixed << n << '\n';
}
else{
cout << "埃氏筛:" << fixed << 1.0 * n * log2(log2(n)) << '\n';
cout << "朴素筛:" << fixed << 1.0 * n * log2(n) << '\n';
}
cout << "暴力♂筛:" << fixed << n * n;
return 0;
}