about summary refs log tree commit diff
path: root/others/easy20160714/20.c
blob: de2c2229f2e51ce3a5ee2e54e466a5fa17be9669 (plain) (blame)
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
#include <stdio.h>
#include <string.h>

int main()
{
	FILE *f = fopen("INP.TXT", "r");
	char x[1001], y[1001], r = 0;
	short m, n, i, j = 0, z[1000][128] = {};

	fscanf(f, "%s %s", x, y);
	fclose(f);

	m = strlen(x);
	n = strlen(y);

	for (i = 0; i < n; i++)
		if ((y[i] == x[j]) && (++j == m)) {
			r = 1;
			break;
		}

	f = fopen("OUT.TXT", "w");
	fputs(r ? "YES\n" : "NO\n", f);
	fclose(f);

	return 0;
}