diff options
Diffstat (limited to 'others/easy20160714/01.c')
-rw-r--r-- | others/easy20160714/01.c | 26 |
1 files changed, 26 insertions, 0 deletions
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 <stdio.h> + +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; +} |