-
Notifications
You must be signed in to change notification settings - Fork 0
/
statement.txt
executable file
·85 lines (76 loc) · 1.97 KB
/
statement.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
برنامه جمله
// این برنامه برای آزمایش پیادهسازی بخش جملهها طراحی شده است
// و هیچ ارزش دیگر ندارد :)
صحیح اصلی () {
صحیح کنترلگر = ۱۰؛
صحیح مقدار = ۱؛
// این تکه کد باید مقدار فاکتوریل کنترلگر را در متغیر مقدار ذخیره کند :)
وقتی (درست) {
اگر کنترلگر < ۰ آنگاه بشکن؛
وگرنه اگر کنترلگر == ۱ آنگاه {}
وگرنه اگر کنترلگر > ۰ آنگاه {
مقدار *= کنترلگر؛
}
کنترلگر--؛
}
// ماشین حساب :)
{
// ۱: جمع
// ۲: تفریق
// ۳: توان
صحیح عملگر = ۱؛
اعشاری اول = ۲.۵؛
صحیح دوم = ۴؛
{}
کلید (عملگر)
حالت ۱:
{
اول += دوم؛
بشکن؛
}؛
حالت ۲:
{
اول = اول - دوم؛
بشکن؛
}؛
حالت ۳:
{
صحیح شمارنده = ۱؛
اعشاری اولیه = اول؛
وقتی (شمارنده < دوم) {
اول *= اولیه؛
}
}؛
پیشفرض:
اول = ۰؛
تمام
}
// آرایه و تصادفی!
{
صحیح آرایه[۳]؛
صحیح ببینیم؛
آرایه[۱] = ۱۰؛
آرایه[۲] = ۲۰؛
آرایه[۳] = ۳۰؛
ببینیم = *آرایه؛
ببینیم = ؟آرایه؛
ببینیم = ؟آرایه؛
ببینیم = ؟آرایه؛
ببینیم = ؟آرایه؛
ببینیم = ؟آرایه؛
ببینیم = ؟آرایه؛
ببینیم = ؟آرایه؛
ببینیم = ؟آرایه؛
ببینیم = ؟آرایه؛
ببینیم = ؟آرایه؛
ببینیم = ؟آرایه؛
آرایه[۲] += آرایه[۳] - ۲۹ + درست و ۱۲ + آرایه[۲]؛
ببینیم = ؟۳؛
ببینیم = ؟۳؛
ببینیم = ؟۳؛
ببینیم = ؟۳؛
ببینیم = ؟۳؛
ببینیم = ؟۳؛
ببینیم = ؟۳؛
}
}