#include<bits/stdc++.h>
#include<math.h>
#include<cmath>
using namespace std;
int a;
void f(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(";
f(i);
cout<<")";
}
x-=pow(2,i);
if(x!=0) cout<<"+";
}
}
}
int main()
{
cin>>a;
f(a);
return 0;
}
P1010 [NOIP1998 普及组] 幂次方
最新推荐文章于 2024-08-08 15:12:59 发布