Run ID:160835
提交时间:2026-09-26 15:05:59
#include<iostream> #include<cstring> using namespace std; string a,b; int main(){ cin>>a; getline(cin,b); int lena = a.size(),lenb = b.size(); for(int i=0;i<lena;i++){ if(a[i]>='A'&&a[i]<='Z') a[i] = a[i]+32; } for(int i=0;i<lenb;i++){ if(b[i]>='A'&&b[i]<='Z') b[i] = b[i]+32; } int first=-1; first = b.find(a); if(first==-1){ cout<<-1<<endl; return 0; } int cnt=1,k=first; while(first != -1){ b.erase(first,lena); first = -1; first = b.find(a); if(first != -1) cnt++; } cout<<cnt<<" "<<k<<endl; return 0; }