Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int swstate;
- int flaga_alarm;
- int i=0;
- int alarm_proc(){
- i++;
- std::cout<<std::endl<<" ALARM "<<i<<std::endl;
- return 0;
- }
- int main(){
- flaga_alarm=0;
- while(1){
- cin>>swstate;
- switch(swstate){
- case 0:
- std::cout<<std::endl<<"-case 0-"<<std::endl;
- if(flaga_alarm==0){
- flaga_alarm=1;
- alarm_proc();
- std::cout<<std::endl<<" po alarmie"<<std::endl;
- }
- break;
- case 1:
- //alt_alarm_stop(&alarm);
- std::cout<<std::endl<<"-case 1-"<<std::endl;
- flaga_alarm=0;
- break;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement