Advertisement
jakubs11

Untitled

Nov 4th, 2013
358
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.61 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int swstate;
  5. int flaga_alarm;
  6. int i=0;
  7.  
  8. int alarm_proc(){
  9.     i++;
  10.     std::cout<<std::endl<<" ALARM "<<i<<std::endl;
  11.     return 0;
  12. }
  13.  
  14. int main(){
  15.     flaga_alarm=0;
  16.     while(1){
  17.         cin>>swstate;
  18.         switch(swstate){
  19.             case 0:
  20.                 std::cout<<std::endl<<"-case 0-"<<std::endl;
  21.                 if(flaga_alarm==0){
  22.                     flaga_alarm=1;
  23.                     alarm_proc();
  24.                     std::cout<<std::endl<<" po alarmie"<<std::endl;
  25.                 }
  26.                 break;
  27.             case 1:
  28.                 //alt_alarm_stop(&alarm);
  29.                 std::cout<<std::endl<<"-case 1-"<<std::endl;
  30.                 flaga_alarm=0;
  31.                 break;
  32.         }
  33.     }
  34.     return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement