-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunction_example.p
More file actions
92 lines (74 loc) · 742 Bytes
/
function_example.p
File metadata and controls
92 lines (74 loc) · 742 Bytes
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
92
float f(int n)
{
if (n <= 2)
return 1
else
return f(n-1)+f(n-2)
}
float f2(int a,int b,float c)
{
return a * b * c
}
int f3(int x){
return x + x
}
void f4(){
int a[10]
int x = 101
void f3(){
write x
x += 10
a[1] = 5
}
f3()
f3()
write x
write a[1]
}
void f5()
{
int y = -2
void g1(){
int x = -1
y += 10
}
void g2(){
g1()
write y
}
g2()
}
void f6()
{
int x = -3
void g(){
x = x * 100
}
void g1(){
int t = 40
g()
write x
}
void g2(){
int u = -50
void g3()
{
write u
g() // x => -30000
//write x // 600
}
g3()
}
g1()
g2()
}
void main()
{
write f3(100)
write f(f2(f2(4,f(4),0.4),1,1))
write f(8) + f2(1,2,6)
write f2(11,2,0.6)
f4()
f5()
f6()
}