-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path10340-2.c
53 lines (52 loc) · 932 Bytes
/
10340-2.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include <stdio.h>
#include <string.h>
main()
{
int i,lc,j,ka,kb,la,lb;
char a[1000000],b[1000000],c[1000000];
while(gets(c))
{
lc=strlen(c);
j=0;
ka=0;
kb=0;
for(i=0;i<lc;i++)
{
if(c[i]!=' ' && j==0)
{
a[ka]=c[i];
ka++;
}
else if(c[i]!=' ' && j==1)
{
b[kb]=c[i];
kb++;
}
else if(c[i]==' ')
{
j=1;
}
}
a[ka]='\0';
b[kb]='\0';
i=0;
la=strlen(a);
lb=strlen(b);
for(j=0;j<lb;j++)
{
if(a[i]==b[j])
{
i++;
}
}
if(i==la)
{
printf("Yes\n");
}
else
{
printf("No\n");
}
}
return 0;
}