-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathex.txt
89 lines (71 loc) · 1.82 KB
/
ex.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
_global
//Acest fisier ar trebui sa se compileze fara nici o eroare. Folositi sintaxa proprie, desigur
int x ;
int x1;
int x2;
int y;
int arr[10];
//declaratii de variabile de toate tipurile de date
float f = 20.0 ;
float f1;
string s = "Mare";
bool b = true;
char c = 'a';
_fnc
int testFunction(int x, float z) {
// puteti pune orice aici
x = 7;
}
int testFunction(int x, int z) {
//puteti pune orice aici
x = 30 + 3;
}
int test(int param1, int param2, float f) {
// puteti pune orice aici
f = 30.5;
}
//niste tipuri de date definite de utilizator clase, struct, ce mai aveti voi
_userdef
struct C1 {
};
struct C2 {
};
begin_progr
//1. exemple de declaratii/initializari/utilizari de obiecte
//2. exemple de instructiuni de asignare; folositi in partea stanga variabile avand toate tipurile de date; folositi in partea stanga orice alt element posibil in limbajul vostru
//ex:
f = 30.0 ;
x = 4;
s = "Tare";
b = false;
c = 'd';
//etc
//3. exemple de instructiuni for, while if, etc
for(x=0;x<10;x=x+1)
{
x1 = 2;
}
while(x2<5)
{
f = f + 23.4;
}
do
{
c = 'f';
}while(b == false);
//4. urmatorul bloc de cod, cu sintaxa voastra proprie, desigur
x = 10; x1 = 20; x2 = 30; y = 100;
if (x1 + test(x1,x2,f) < 5 + x1 and ((x > 2 or x1 < 4+x2) or x == 2))
{
x = 2;
//si alte lucruri aici
}
x = test(test(x1,3,f)+2, y+4, f) + (30 - y * arr[2]) - 10;
x1 = x*100 + 5 * 100 + arr[2];
Eval(x*10-100);
Eval(x1);
Eval(x2* 10-200) ;
Eval(x+ test(x1,x,f)) ;
TypeOf(x+23);
TypeOf(f-30.0);
end_progr