-
Notifications
You must be signed in to change notification settings - Fork 1
/
translate.c
36 lines (35 loc) · 1.4 KB
/
translate.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
34
35
36
#include <stdio.h>
#include <sys/types.h>
int main() {
unsigned long long order = 0;
scanf("%lx", &order);
printf("%lx\n", order);
unsigned lettuce = order & 0x1f;
unsigned unchopped_lettuce = (order >> 5) & 0x1f;
unsigned unwashed_unchopped_lettuce = (order >> 10) & 0x1f;
unsigned onions = (order >> 15) & 0x1f;
unsigned unchopped_onions = (order >> 20) & 0x1f;
unsigned tomatoes = (order >> 25) & 0x1f;
unsigned unwashed_tomatoes = (order >> 30) & 0x1f;
unsigned overcooked_meat = (order >> 35) & 0x1f;
unsigned meat = (order >> 40) & 0x1f;
unsigned uncooked_meat = (order >> 45) & 0x1f;
unsigned cheese = (order >> 50) & 0x1f;
unsigned bread = (order >> 55) & 0x1f;
unsigned prepadding = (order >> 60) & 0xf;
printf("prepadding: %zu\n \
bread: %zu\n \
cheese: %zu\n \
uncooked_meat: %zu\n \
meat: %zu\n \
overcooked_meat: %zu\n \
unwashed_tomatoes: %zu\n \
tomatoes: %zu\n \
unchopped_onions: %zu\n \
onions: %zu\n \
unwashed_unchopped_lettuce: %zu\n \
unchopped_lettuce %zu\n \
lettuce: %zu\n", prepadding, bread, cheese, uncooked_meat, meat, overcooked_meat, unwashed_tomatoes, tomatoes, unchopped_onions,
onions, unwashed_unchopped_lettuce, unchopped_lettuce, lettuce);
return 0;
}