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,9 @@
2 S
TH
9C
KS
QS
JS
TD
AD
JH

View File

@ -0,0 +1,17 @@
4 H
AH
KH
QH
JH
TH
9H
8H
7H
AS
KS
QS
JS
TS
9S
8S
7S

View File

@ -0,0 +1,51 @@
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv) {
int hands;
char dominant;
scanf("%d %c", &hands, &dominant);
int points = 0;
for (int i=0; i<hands*4; i++) {
char card, suit;
scanf(" %c%c", &card, &suit); // <--- The god damn space in front!!
switch (card) {
case 'A':
points += 11;
break;
case 'K':
points += 4;
break;
case 'Q':
points += 3;
break;
case 'J':
if (dominant == suit) {
points += 20;
break;
}
points += 2;
break;
case 'T':
points += 10;
break;
case '9':
if (dominant == suit) {
points += 14;
break;
}
default:
points += 0;
break;
}
}
printf("%d\n", points);
}