diff options
Diffstat (limited to 'day1.c')
-rw-r--r-- | day1.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -0,0 +1,16 @@ +#include <stdio.h> + +int main() { + int ch, floor = 0; + while ((ch = getchar()) != EOF) { + switch(ch) { + case '(': + floor += 1; + break; + case ')': + floor -= 1; + } + } + printf("%d\n", floor); + return 0; +} |