mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-12-24 03:11:58 +00:00
773. 字符串插入
https://www.acwing.com/problem/content/submission/code_detail/8097849/
This commit is contained in:
parent
3fc12e9ae2
commit
af3cb117d4
23
AcWing/773/773.cpp
Normal file
23
AcWing/773/773.cpp
Normal file
@ -0,0 +1,23 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
string s, s1;
|
||||
|
||||
int main() {
|
||||
while (cin >> s >> s1) {
|
||||
bool flag = false;
|
||||
char c = 'z';
|
||||
while (!flag) {
|
||||
if (s.find_first_of(c) != string::npos) {
|
||||
s.insert(s.find_first_of(c) + 1, s1);
|
||||
flag = true;
|
||||
break;
|
||||
}
|
||||
c--;
|
||||
}
|
||||
cout << s << endl;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user