也是个水题,两个串一一比较就行。,。。。现在只能1A这种水题了
#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<cstring>
#include<algorithm>
using namespace std;
int main()
{
char s[3][100100];
while (scanf("%s",s[1])!=EOF)
{
scanf("%s",s[2]);
int len2=strlen(s[2]);
int len1=strlen(s[1]);
int head=0;
for (int i=0;i<len2;i++)
if (s[2][i]==s[1][head])
head++;
if (head==len1) printf("Yes\n");
else printf("No\n");
}
return 0;
}

本文提供了一个简单的C++程序,用于比较两个字符串是否完全相同。通过遍历字符串并逐字符匹配,实现基本的字符串比较功能。
516

被折叠的 条评论
为什么被折叠?



