Moved kattis from Uni repo

This commit is contained in:
2023-12-01 13:35:13 +01:00
parent 28a6b807a3
commit aaa2c123b8
164 changed files with 3008 additions and 0 deletions

View File

@ -0,0 +1 @@
Firing up EmoticonBot... (: : ( ): :D c:

View 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;
}

Binary file not shown.