Moved kattis from Uni repo
This commit is contained in:
1
kattis/problems/06_11_23/deadoralive/3.in
Normal file
1
kattis/problems/06_11_23/deadoralive/3.in
Normal file
@ -0,0 +1 @@
|
||||
Firing up EmoticonBot... (: : ( ): :D c:
|
43
kattis/problems/06_11_23/deadoralive/main.c
Normal file
43
kattis/problems/06_11_23/deadoralive/main.c
Normal file
@ -0,0 +1,43 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
char c;
|
||||
int smiley = 0;
|
||||
int frowny = 0;
|
||||
int eyes = 0;
|
||||
|
||||
// Would be easier if we stored it but why tf not ig
|
||||
int i = 0;
|
||||
while ((c = getchar()) != '\n') {
|
||||
|
||||
// PROUD OF THIS
|
||||
// ↓↓↓↓↓↓↓↓↓↓↓↓↓
|
||||
if (i - eyes > 1) {
|
||||
eyes = 0;
|
||||
}
|
||||
|
||||
if (c == ':') {
|
||||
eyes = i;
|
||||
}
|
||||
if (c == ')' && eyes ) {
|
||||
smiley++;
|
||||
}
|
||||
if (c == '(' && eyes) {
|
||||
frowny++;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
if (frowny && ! smiley) {
|
||||
printf("undead\n");
|
||||
} else if (smiley && !frowny) {
|
||||
printf("alive\n");
|
||||
} else if (smiley && frowny) {
|
||||
printf("double agent\n");
|
||||
} else {
|
||||
printf("machine\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
BIN
kattis/problems/06_11_23/deadoralive/program
Executable file
BIN
kattis/problems/06_11_23/deadoralive/program
Executable file
Binary file not shown.
Reference in New Issue
Block a user