提交时间:2026-04-04 18:57:04
运行 ID: 435285
#include<bits/stdc++.h> using namespace std; string s,t; int main(){ int n; cin>>s>>t; int l=s.size(); for(int i=0;i<l;i++){ if(s[i]==t[0]){ n=i; break; } } int m=l-n; if(m<l-m){ cout<<m; }else { cout<<l-m; } return 0; }