-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAmusing joke.cpp
More file actions
41 lines (40 loc) · 851 Bytes
/
Amusing joke.cpp
File metadata and controls
41 lines (40 loc) · 851 Bytes
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
#include<stdio.h>
#include<string.h>
int main()
{
int i,j,length_1,length_2,length_3,z=0,x=0;
char a[101],b[101],c[101];
gets(a);gets(b);gets(c);
length_1=strlen(a);length_2=strlen(b);length_3=strlen(c);
char d[length_1+length_2];
if(length_1+length_2 != length_3){
printf("NO");
}
else {
for(i=0;i<length_1+length_2;i++){
if(i<length_1){
d[i]=a[i];
}
else{
d[i]=b[i-length_1];
}
z=0;
for(j=0;j<length_3;j++){
if(d[i]==c[j]){
z++;
c[j]='0';
break;
}
}
if(z==0){
x++;
printf("NO");
break;
}
}
if(x==0){
printf("YES");
}
}
return 0;
}