如何评价。
开摆中……掉颜色咯!
$$\boxed{\begin{matrix}
\cr[-3pt]\texttt{反馈}\cr[3pt]
\footnotesize\texttt{\kern{15pt}如果你认为某个帖子有问题,欢迎向洛谷反馈,以帮助更多的同学。\kern{15pt}}\cr[14pt]
\colorbox{#3bb4f2}{\raisebox{12pt}{\text{ }}\raisebox{3pt}{\color{white}无法令人理解的无意$\cdots\tiny\nabla$}}\cr[10pt]
\footnotesize\texttt{请具体说明理由,以增加反馈的可信度。}\cr[5pt]
\fcolorbox{#000000}{#ffffff}{|\kern{200pt}}\cr
\color{#dedede}\kern{-3pt}\underline{\kern{300pt}}\kern{-3pt}\cr[-2pt]\text{\color{#dedede}\huge|}\cr[-14pt]
\color{#0e90d2}\text{取消\kern{126pt}\text{确定}}
\end{matrix}}$$最新消息:
举世神帖!!!超越小L,比肩UKE!
主页
摩斯电码转换器
大事记
· 2023-4-11 入坑洛谷
· 2023-12-6 4级勾!本来以为不行的
· 终于水过3紫了……(累死)2023-12-6
- 考GESP4级,简单,爆切 2023-12-9
- 快要200咕值了呢,加油! 2023-12-15
- 新的一年!咕值201! 2024-1-1
- 红名了! 2024-3-11
- AC 400了! 2024-4-6
- 首杀黑题!(不过这道题1e10的运行次数过了6秒,CF评测机牛逼!) 2024-5-6
前方施工中……
也许不会施工了
最近更新:2025-1-1
按 f12,ctrl+shift+C后选中那个框点一下;
在右侧的框中找到 "Display:none" 双击把他删除。
然后能快乐的看啦!!!!#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
#define int long long
struct node
{
int x, y;
}a[10000001];
vector<int> ans;
int n, cnt = 0;
void print(string s);
void PRINTint(int n)
{
system("cls");
print("你输入的数是:");
cout << n << "\n";
}
void PRINTf(double n)
{
system("cls");
print("你输入的数是(可能不精确):");
printf("%lf\n", n);
}
int qpow(int x, int y)
{
int ans = 1;
while(y)
{
if(y & 1)
{
ans = ans * x;
}
x *= x;
y >>= 1;
}
return ans;
}
void solve1()
{
cin >> n;
if(n == 1)
{
PRINTint(n);
print("它的立方根是 1");
return;
}
int N = n;
for(int i = 2; i <= sqrt(N); i++)
{
while(n % i == 0)
{
n /= i;
ans.push_back(i);
}
}
if(n != 1)
{
ans.push_back(n);
}
a[++cnt] = {ans[0], 1};
bool f = 0;
for(auto i : ans)
{
if(!f)
{
f = 1;
continue;
}
if(a[cnt].x == i)
{
a[cnt].y++;
}
else
{
a[++cnt] = {i, 1};
}
}
PRINTint(N);
print("代数式表达: ");
for(int i = 1; i < cnt; i++)
{
if(a[i].y % 3 == 0)
{
cout << a[i].x << "^" << a[i].y / 3 << "(" << qpow(a[i].x, a[i].y / 3) << ") * ";
}
else
{
cout << a[i].x << "^" << a[i].y << "/3" << " * ";
}
}
if(a[cnt].y % 3 == 0)
{
cout << a[cnt].x << "^" << a[cnt].y / 3 << "(" << qpow(a[cnt].x, a[cnt].y / 3) << ")";
}
else
{
cout << a[cnt].x << "^" << a[cnt].y << "/3";
}
print("\n\n大约等于: ");
printf("%.10lf", cbrt(N));
}
void solve2()
{
double N;
cin >> N;
PRINTf(N);
print("它的立方根(大约)是:");
printf("%.10lf", cbrt(N));
}
void print(string s)
{
for(auto i : s)
{
cout << i;
Sleep(30);
}
}
signed main()
{
system("color 74");
print("计算立方根!小数(1)还是整数(2)?");
int op;
cin >> op;
if(op == 1)
{
print("请输入一个小数,请不要带有其他符号:");
solve2();
}
else
{
print("请输入一个整数,请不要带有其他符号:");
solve1();
}
}


