题目
#include<bits/stdc++.h>
using namespace std;
int n;
int a[10] = {1};
void print(int t)
{
cout << n << "=";
for(int i = 1; i < t; i ++)
cout << a[i] << "+";
cout << a[t] << "\n";
}
int dfs(int s, int t)
{
for(int i = a[t - 1]; i <= s; i ++)
{
if(i < n)
{
a[t] = i;
s -= i;
if(s == 0)
print(t);
else
dfs(s, t + 1);
s += i;
}
}
}
int main()
{
ios::sync_with_stdio(0);
cin.tie(0), cout.tie(0);
cin >> n;
dfs(n, 1);
return 0;
}