Run ID | 作者 | 问题 | 语言 | 测评结果 | 分数 | 时间 | 内存 | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|---|
168742 | Mino_XIE-谢文凯B班 | 幂次方 | C++ | 编译错误 | 0 | 0 MS | 0 KB | 461 | 2024-08-20 13:33:36 |
#include<iostream> #include<cmath> using namespace std; int a; void fff(int x){ for(int i=14;i>=0;i--){ if(pow(2,i)<=x){ if(i==1) cout<<"2"; else if(i==0) cout<<"2(0)"; else{ cout<<"2("; fff(i); cout<<")"; } x-=pow(2,i); if(x!=0) cout<<"+"; } } } int main(){ cin>>a; solve(a); return 0; }