-
Notifications
You must be signed in to change notification settings - Fork 0
/
big.input.txt
91 lines (79 loc) · 1.47 KB
/
big.input.txt
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
pair:struct {
integer:int;
character:char;
};
acme:[2]struct {
employees: [2]struct { age:int; };
};
fibonacci:[8][3]int;
#-------------------------------
def p(): {}
def f(r:double, e:int):int {
real:double;
c:char;
result:int;
real = r * 10.0;
c='0';
if e < 256: {
c = (char)e;
result = (int)c;
}
else:
result = (int)real;
return result;
}
def initialize(): {
i:int;
fibonacci[0][0] = 0;
fibonacci[0][1] = 1;
fibonacci[0][2] = 1;
i = 1;
while i < 8: {
fibonacci[i][0] = fibonacci[i - 1][1];
fibonacci[i][1] = fibonacci[i - 1][2];
fibonacci[i][2] = fibonacci[i][0] + fibonacci[i][1];
i = i + 1;
}
}
#-------------------------------
def main(): {
i, j:int;
p();
i=0;
pair.character='0';
pair.integer=(int)'0';
# Shows 48 (decimal value of '0')
print f((double)i, (int)(pair.character)), '\n';
f(1.3, 2);
initialize();
i = 0;
while i < 8: {
# Shows the Fib sequence, from 1 to 8 (34)
print '(', i + 1, ')', fibonacci[i][0],
'+', fibonacci[i][1] , '=' ,
fibonacci[i][2] , '\n';
i = i + 1;
}
acme[1].employees[1].age = 56;
# Shows 56
print acme[1].employees[1].age, '\n';
i = 0;
while i<2: {
j = 0;
while j<2: {
acme[i].employees[j].age = i + j;
j = j+ 1;
}
i= i + 1;
}
i = 0;
while i<2: {
j = 0;
while j<2: {
# Shows 0 1 1 2
print acme[i].employees[j].age, ' ';
j = j+ 1;
}
i= i + 1;
}
}