#include #define ALL(v) v.begin(), v.end() typedef long long ll; using namespace std; int main() { string n,temp; int maxx = 0; cin >> n; maxx = stoi(n); for (int i = 0; i < n.length(); i++) { for (int j = 0; j < n.length(); j++) { temp = n; char a = n[i]; char b = n[j]; temp[i] = b; temp[j] = a; int tempI = stoi(temp); maxx = max(maxx, tempI); } } cout << maxx << endl; }