-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathp375.c
33 lines (32 loc) · 775 Bytes
/
p375.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* Pistas de aterrizaje */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main() {
char in[4], numero[3];
int out;
while(scanf("%s", in) != EOF) {
strncpy(numero, in, 2);
if(strlen(in) == 2) {
out = (atoi(numero)+18)%36;
if(out == 0)
printf("36");
else
printf("%02d", out);
} else {
out = (atoi(numero)+18)%36;
if(out == 0)
printf("36");
else
printf("%02d", out);
if(in[2] == 'C')
printf("C");
else if(in[2] == 'L')
printf("R");
else
printf("L");
}
printf("\n");
}
return 0;
}