行吧,请问C++有没有strlwr函数,本地编译没问题洛谷CE
查看原帖
行吧,请问C++有没有strlwr函数,本地编译没问题洛谷CE
376467
QDHSLGYYJK楼主2020/11/22 14:38
#include<cstdio>
#include<cstring>
using namespace std;
int main(){
	char c1[15],c2[15];
	int p=-1,l=0;
	scanf("%s",c1);
	strlwr(c1);
	int ans=0;
	while (scanf("%s",c2)!=EOF){
		strlwr(c2);
		if (!(strcmp(c1,c2))){
			++ans;
			if (p==-1)
				p=l;
		}
		l+=strlen(c2)+1;
	}
	if (ans)
		printf("%d %d",ans,p);
	else
		printf("-1");
	return 0;
}

CE

2020/11/22 14:38
加载中...