diff --git a/1811A Insert Digit/1811A.cpp b/1811A Insert Digit/1811A.cpp new file mode 100644 index 0000000..cdb5a21 --- /dev/null +++ b/1811A Insert Digit/1811A.cpp @@ -0,0 +1,35 @@ +#include +using namespace std; +using ll = long long; + +void solve() +{ + int n; + char c; + cin >> n >> c; + string s; + cin >> s; + for (int i = 0; i < s.size(); ++i) + { + if (c > s[i]) + { + s.insert(i, 1, c); + cout << s << endl; + return; + } + } + s=s+c; + cout<> TC; + cin.ignore(); + while (TC--) + solve(); +} \ No newline at end of file