Moved kattis from Uni repo
This commit is contained in:
2
kattis/problems/06_11_23/pokechat/1.in
Normal file
2
kattis/problems/06_11_23/pokechat/1.in
Normal file
@ -0,0 +1,2 @@
|
||||
PpIiKkAaCcHhUu
|
||||
001004006008010012014
|
2
kattis/problems/06_11_23/pokechat/2.in
Normal file
2
kattis/problems/06_11_23/pokechat/2.in
Normal file
@ -0,0 +1,2 @@
|
||||
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ .,?!0123456789
|
||||
016009011001053016009011001
|
26
kattis/problems/06_11_23/pokechat/main.c
Normal file
26
kattis/problems/06_11_23/pokechat/main.c
Normal file
@ -0,0 +1,26 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
char translationKey[256];
|
||||
char c;
|
||||
int i = 0;
|
||||
while ((c = getchar()) != '\n') {
|
||||
translationKey[i] = c;
|
||||
i++;
|
||||
}
|
||||
|
||||
while (1) {
|
||||
int phrase;
|
||||
int check = scanf("%3d", &phrase);
|
||||
if (check != 1) {
|
||||
break;
|
||||
}
|
||||
// printf("%d, %d\n", phrase, check);
|
||||
printf("%c", translationKey[phrase-1]);
|
||||
}
|
||||
|
||||
printf("\n");
|
||||
|
||||
return 0;
|
||||
}
|
26
kattis/problems/06_11_23/pokechat/main.c.orig
Normal file
26
kattis/problems/06_11_23/pokechat/main.c.orig
Normal file
@ -0,0 +1,26 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
char translationKey[256];
|
||||
char c;
|
||||
int i = 0;
|
||||
while ((c = getchar()) != '\n') {
|
||||
translationKey[i] = c;
|
||||
i++;
|
||||
}
|
||||
|
||||
|
||||
while (1) {
|
||||
int phrase;
|
||||
int check = scanf("3%d", &phrase);
|
||||
if (check != 1) {
|
||||
break;
|
||||
}
|
||||
printf("%c\n", translationKey[phrase-1]);
|
||||
}
|
||||
|
||||
printf("\n");
|
||||
|
||||
return 0;
|
||||
}
|
BIN
kattis/problems/06_11_23/pokechat/program
Executable file
BIN
kattis/problems/06_11_23/pokechat/program
Executable file
Binary file not shown.
Reference in New Issue
Block a user