mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-10 00:18:48 +00:00
parent
4b6fd25256
commit
dc201bad90
17
S2OJ/857/857.cpp
Normal file
17
S2OJ/857/857.cpp
Normal file
@ -0,0 +1,17 @@
|
||||
#include <bits/stdc++.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int n, a, l, r;
|
||||
string s, s1, s2;
|
||||
|
||||
int main() {
|
||||
getline(cin, s, ',');
|
||||
getline(cin, s1, ',');
|
||||
getline(cin, s2);
|
||||
n = s.find(s1);
|
||||
a = s.rfind(s2);
|
||||
l = s1.size();
|
||||
r = s2.size();
|
||||
cout << (a <= n || a == -1 || n == -1 || a < n + l - 1 ? -1 : a - n - l) << endl;
|
||||
}
|
Loading…
Reference in New Issue
Block a user