diff options
author | Nguyễn Gia Phong <vn.mcsinyx@gmail.com> | 2019-06-17 17:48:03 +0700 |
---|---|---|
committer | Nguyễn Gia Phong <vn.mcsinyx@gmail.com> | 2019-06-17 17:48:03 +0700 |
commit | 27d4089726131b1b63dd4bc5592076c8153acdd3 (patch) | |
tree | 0eaf21d02b85ec39be146babe72a942129b4cca2 /codechef/ks2.c | |
parent | 267b2db7addc95c5eebb8bfb9ceeb7b953d85732 (diff) | |
download | cp-27d4089726131b1b63dd4bc5592076c8153acdd3.tar.gz |
I'm not as good at math as I expect
Diffstat (limited to 'codechef/ks2.c')
-rw-r--r-- | codechef/ks2.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/codechef/ks2.c b/codechef/ks2.c new file mode 100644 index 0000000..6681de6 --- /dev/null +++ b/codechef/ks2.c @@ -0,0 +1,18 @@ +/* + * Me, as a maintainer: No, you can NOT use magic numbers like that! + * Also me, doing competitive: + */ +#include <stdio.h> + +int main() +{ + int t, a, c; + + scanf("%d ", &t); + while (t--) { + for (a = 420; (c = getchar()) > 42; a += 48 - putchar(c)); + printf("%d\n", a % 10); + } + + return 0; +} |