Moved kattis from Uni repo
This commit is contained in:
9
kattis/problems/old/bela/1.in
Normal file
9
kattis/problems/old/bela/1.in
Normal file
@ -0,0 +1,9 @@
|
||||
2 S
|
||||
TH
|
||||
9C
|
||||
KS
|
||||
QS
|
||||
JS
|
||||
TD
|
||||
AD
|
||||
JH
|
17
kattis/problems/old/bela/2.in
Normal file
17
kattis/problems/old/bela/2.in
Normal file
@ -0,0 +1,17 @@
|
||||
4 H
|
||||
AH
|
||||
KH
|
||||
QH
|
||||
JH
|
||||
TH
|
||||
9H
|
||||
8H
|
||||
7H
|
||||
AS
|
||||
KS
|
||||
QS
|
||||
JS
|
||||
TS
|
||||
9S
|
||||
8S
|
||||
7S
|
51
kattis/problems/old/bela/main.c
Normal file
51
kattis/problems/old/bela/main.c
Normal 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);
|
||||
}
|
Reference in New Issue
Block a user