From 7206ecee7579a10dd347d06b397b3790e969f8f3 Mon Sep 17 00:00:00 2001 From: Raphael McSinyx Date: Sun, 1 Jan 2017 21:05:53 +0700 Subject: Add others/easy20160714 --- others/easy20160714/01.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 others/easy20160714/01.c (limited to 'others/easy20160714/01.c') diff --git a/others/easy20160714/01.c b/others/easy20160714/01.c new file mode 100644 index 0000000..9f36e46 --- /dev/null +++ b/others/easy20160714/01.c @@ -0,0 +1,26 @@ +#include + +int main() +{ + FILE *f = fopen("INP.TXT", "r"); + short x; + + fscanf(f, "%hd", &x); + + fclose(f); + + if (x > -2) + x = -2; + else + do + x--; + while (x % 2); + + f = fopen("OUT.TXT", "w"); + + fprintf(f, "%hd\n", x); + + fclose(f); + + return 0; +} -- cgit 1.4.1