Moved kattis from Uni repo
This commit is contained in:
4
kattis/problems/13_11_23/sith/1.in
Normal file
4
kattis/problems/13_11_23/sith/1.in
Normal file
@ -0,0 +1,4 @@
|
||||
Obi-Wan Kenobi
|
||||
69
|
||||
80
|
||||
-11
|
4
kattis/problems/13_11_23/sith/3.in
Normal file
4
kattis/problems/13_11_23/sith/3.in
Normal file
@ -0,0 +1,4 @@
|
||||
Grogu
|
||||
67
|
||||
17
|
||||
50
|
21
kattis/problems/13_11_23/sith/main.c
Normal file
21
kattis/problems/13_11_23/sith/main.c
Normal file
@ -0,0 +1,21 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
|
||||
int a, b, diff;
|
||||
char c;
|
||||
while ((c=getchar()) != '\n' ) {
|
||||
continue;
|
||||
}
|
||||
scanf("%d %d %d", &a, &b, &diff);
|
||||
|
||||
if (abs(a-b) == diff && a - b != diff) {
|
||||
printf("SITH\n");
|
||||
} else if (a - b == diff && abs(a-b) != diff ) {
|
||||
printf("JEDI\n");
|
||||
} else {
|
||||
printf("VEIT EKKI\n");
|
||||
}
|
||||
return 0;
|
||||
}
|
25
kattis/problems/13_11_23/sith/main.c.orig
Normal file
25
kattis/problems/13_11_23/sith/main.c.orig
Normal file
@ -0,0 +1,25 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int absolute(int x) {
|
||||
return x < 0 ? -x : x;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
|
||||
int a, b, diff;
|
||||
char c;
|
||||
while ((c=getchar()) != '\n' ) {
|
||||
continue;
|
||||
}
|
||||
scanf("%d %d %d", &a, &b, &diff);
|
||||
|
||||
if (absolute(a-b) == diff) {
|
||||
printf("SITH\n");
|
||||
} else if (a - b == diff && absolute(a-b) != diff) {
|
||||
printf("JEDI\n");
|
||||
} else {
|
||||
printf("VEIT EKKI\n");
|
||||
}
|
||||
return 0;
|
||||
}
|
BIN
kattis/problems/13_11_23/sith/program
Executable file
BIN
kattis/problems/13_11_23/sith/program
Executable file
Binary file not shown.
Reference in New Issue
Block a user