#include <stdio.h>
int arr[] = {1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8128, 16256};
void f(int n)
{
int i;
int status = 0;
for(i = 14; i >= 0; i--)
if((n - arr[i]) >= 0){
n -= arr[i];
if(i >= 2){
if(status){
printf("+");
}
printf("2(");
f(i);
printf(")");
status = 1;
}
else if(i == 1){
if(status){
printf("+");
}
printf("2");
status = 1;
}
else if(i == 0){
if(status){
printf("+");
}
printf("2(0)");
status = 1;
}
}
}
int main(void)
{
int n;
scanf("%d", &n);
f(n);
printf("\n");
return 0;
}
```#include <stdio.h>
int arr[] = {1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8128, 16256};
void f(int n)
{
int i;
int status = 0;
for(i = 14; i >= 0; i--)
if((n - arr[i]) >= 0){
n -= arr[i];
if(i >= 2){
if(status){
printf("+");
}
printf("2(");
f(i);
printf(")");
status = 1;
}
else if(i == 1){
if(status){
printf("+");
}
printf("2");
status = 1;
}
else if(i == 0){
if(status){
printf("+");
}
printf("2(0)");
status = 1;
}
}
}
int main(void)
{
int n;
scanf("%d", &n);
f(n);
printf("\n");
return 0;
}