0分,帮调,壶关
查看原帖
0分,帮调,壶关
1375065
linkai20111030楼主2025/8/1 21:28
#include<bits/stdc++.h>
#define int long long
using namespace std;
string s;
int ss;
bool ab(string x,int len){
    bool a,b;
    for(int i=0;i<len;i++){
        if(x[i]>='1'&&x[i]<='9')
            a=1;
        else if(x[i]>='a'&&x[i]<='z'||x[i]>='A'&&x[i]<='Z')
            ;
        else
            b=1;
        if(a==1&&b==1)
            return 1;
    }
    return 0;
}
signed main(){
    cin>>s;
    int len=s.size();
    for(int l=0;l<len;l++){
        for(int r=l+7;r<min(len,l+16);r++){
            string x=s.substr(l,r);
            if(ab(x,r-l+1))
                ss++;
        }
    }
    cout<<ss;
}
2025/8/1 21:28
加载中...