From 57d767cf4e4d5b83645bda2c4e398fdd76d059e1 Mon Sep 17 00:00:00 2001 From: Raphael McSinyx Date: Mon, 2 Jan 2017 20:37:59 +0700 Subject: Update others/easy20160714 --- others/easy20160714/20.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 others/easy20160714/20.c (limited to 'others/easy20160714/20.c') diff --git a/others/easy20160714/20.c b/others/easy20160714/20.c new file mode 100644 index 0000000..de2c222 --- /dev/null +++ b/others/easy20160714/20.c @@ -0,0 +1,27 @@ +#include +#include + +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; +} -- cgit 1.4.1