Pliki_SOP/zajecia8/zad1.cm

27 lines
247 B
Plaintext
Raw Normal View History

2018-12-05 18:09:07 +01:00
monitor s{
int suma;
void inc() {
suma=suma+1;
}
int getSuma() {
return suma;
}
init{
suma=0;
}
}
void pro(int n){
int i;
for(i=0; i<n; i=i+1) inc();
}
main(){
cobegin{
pro(10); pro(10);
}
cout << getSuma() << endl;
}