Moved kattis from Uni repo
This commit is contained in:
27
kattis/problems/old/smil/main.c
Normal file
27
kattis/problems/old/smil/main.c
Normal file
@ -0,0 +1,27 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
char c;
|
||||
int idx = -1;
|
||||
int counter = 0;
|
||||
int nose = -1;
|
||||
|
||||
while ((c = getchar()) != '\n') {
|
||||
// Eyes
|
||||
if (c == ':' || c == ';') {
|
||||
idx = counter;
|
||||
} else if (c == '-' && (idx != -1)) {
|
||||
nose = 1;
|
||||
} else if ((c == ')' && (idx != -1)) ||(c == ')' && nose && (idx != -1)) ) {
|
||||
printf("%d\n", idx);
|
||||
idx = -1;
|
||||
nose = 0;
|
||||
} else {
|
||||
idx = -1;
|
||||
nose = 0;
|
||||
}
|
||||
counter++;
|
||||
}
|
||||
return 0;
|
||||
}
|
Reference in New Issue
Block a user