![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/b166865cd79abefadd9a2448d0e4a267.png)
#include<iostream>
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<bits/stdc++.h>
using namespace std;
int n;
int a[17];
int work(int x){
if(x == 0){
printf("0");
return 0;
}
if(x == 2){
printf("2");
return 0;
}
while(1){
int i;
for(i = 16; a[i] > x; --i);
if(a[i] != 2){
printf("2(");
work(i);
printf(")");
}
else{
printf("2");
}
if(x - a[i])printf("+"),x = x - a[i];
else
return 0;
}
}
int main(){
a[0] = 1;
for(int i = 1; i <= 16; ++i)a[i] = a[i-1] * 2;
scanf("%d",&n);
work(n);
return 0;
}