30 lines
650 B
Plaintext
30 lines
650 B
Plaintext
|
BACI System: C-- to PCODE Compiler in C, 11:30 1 Oct 2012
|
||
|
Source file: zad1.cm Mon Dec 3 16:10:29 2018
|
||
|
line pc
|
||
|
1 0 monitor s{
|
||
|
2 0 int suma;
|
||
|
3 0 void inc() {
|
||
|
4 1 suma=suma+1;
|
||
|
5 6 }
|
||
|
6 8
|
||
|
7 8 int getSuma() {
|
||
|
8 9 return suma;
|
||
|
9 13 }
|
||
|
10 15
|
||
|
11 15 init{
|
||
|
12 15 suma=0;
|
||
|
13 18 }
|
||
|
14 19 }
|
||
|
15 19
|
||
|
16 19 void pro(int n){
|
||
|
17 19 int i;
|
||
|
18 19 for(i=0; i<n; i=i+1) inc();
|
||
|
19 37 }
|
||
|
20 38
|
||
|
21 38 main(){
|
||
|
22 39 cobegin{
|
||
|
23 40 pro(10); pro(10);
|
||
|
24 48 }
|
||
|
25 49 cout << getSuma() << endl;
|
||
|
26 54 }
|