Skip to content

Commit

Permalink
Add kattis prob abc in C
Browse files Browse the repository at this point in the history
  • Loading branch information
iandioch committed Feb 23, 2017
1 parent 040e5d9 commit 4474000
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions kattis/abc/solution.c
@@ -0,0 +1,19 @@
#include <stdio.h>
#include <stdlib.h>

int compare (const void * a, const void * b) {
return (*(int*)a - *(int*)b);
}

int main() {
int n[3];
scanf("%d %d %d", &n[0], &n[1], &n[2]);
qsort(n, 3, sizeof(int), compare);
char c[5];
scanf("%s", c);
int i;
for (i = 0; i < 3; ++i) {
printf("%d ", n[c[i]-'A']);
}
printf("\n");
}

0 comments on commit 4474000

Please sign in to comment.