10分求助!!!!
查看原帖
10分求助!!!!
418419
ko_no_lzx_da楼主2021/10/21 10:55
#include<iostream>
#include<cstring>
#include<string>
#include<cstdio>
#include<queue>
#include<cmath>
#include<algorithm>
using namespace std;
string a;
int n=0,one,ans=0;
bool gg=true;
string b;
int main(){
	cin >>a;
	while(cin>>b){
		bool f=true;
		for(int i=0;i<b.length();i++){
			if(b[i]!=a[i]&&b[i]!=a[i]+('a'-'A')&&b[i]!=a[i]-('a'-'A')){
				f=false;
				break;
			}
		}
		if(f){
			ans++;
			if(gg){
				one=n;
				gg=false;
			}
		}
		n++;
	}
	if(ans==0){
		cout <<-1;
	}else{
		cout <<ans<<" "<<one;
	}
	return 0;
}


2021/10/21 10:55
加载中...