#include <iostream> #include <vector> using namespace std; void er(int x) { vector<int> nums; int k = 0; while (x > 0) { if (x % 2) nums.push_back(k); k++; x /= 2; } for (int i = nums.size()-1; i > 0; i--) { if (nums[i] == 1) { cout << 2 << '+'; continue; } else if (nums[i] == 0) { cout << "2(0)" << '+'; continue; } cout << 2 << '('; er(nums[i]); cout << ')'; cout << '+'; } if (nums[0] == 1) { cout << 2 ; } else if (nums[0] == 0) { cout << "2(0)" ; } else{cout << 2 << '('; er(nums[0]); cout << ')'; } } int main() { int n; cin >> n; er(n); } // 64 位输出请用 printf("%lld")