求助(
查看原帖
求助(
1022472
C_Boa楼主2024/5/14 19:03
#include<bits/stdc++.h>
using namespace std; 
string s,t;
int cnt=0;
int main(){
    cin>>s>>t;
    for(int i=0;i<s.size();i++){
        for(int j=0;j<t.size();j++){
            if(j>=s.size()||i>=t.size()) break;
            if(s[i]==t[j]) cnt++;
        }
    }
    if(cnt) cout<<cnt;
    else cout<<0;
    return 0;
}
/*
abc
bc
*/
/*
aaaaa
bbbbb
*/
2024/5/14 19:03
加载中...