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 @@
1-3;5;7;10-13

View File

@ -0,0 +1 @@
1;3;5;8;13

View File

@ -0,0 +1,30 @@
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv) {
int problems = 0;
while (1) {
int start;
scanf("%d", &start);
char c;
scanf("%c", &c);
if (c == '-') {
int end;
scanf("%d", &end);
problems += end - start + 1;
char x = getchar();
if (x == ';') continue;
else break;
} else if (c == ';') {
problems += 1;
continue;
} else {
problems += 1;
break;
}
}
printf("%d\n", problems);
}