rengetsu

MIDI_CodeJam.4.Viesbutis

Apr 6th, 2018
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.76 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.     long long int test=0,min[10000], max[10000];
  6.     char tire;
  7.     cin>>min[0]>>tire>>max[0];
  8.     a:
  9.     if(test>=min[0] && test<=max[0])
  10.     {
  11.         test+=1;
  12.         goto a;
  13.     }
  14.     else
  15.     {
  16.         cin>>min[1]>>tire>>max[1];
  17.         b:
  18.         if(test>=min[1] && test<=max[1])
  19.         {
  20.             test+=1;
  21.             goto b;
  22.         }
  23.         else
  24.         {
  25.             cin>>min[2]>>tire>>max[2];
  26.             c:
  27.             if(test>=min[2] && test<=max[2])
  28.             {
  29.                 test+=1;
  30.                 goto c;
  31.             }
  32.             else
  33.             {
  34.                 cout<<test<<endl;
  35.                 return 0;
  36.             }
  37.         }
  38.     }
  39.     return 0;
  40. }
Add Comment
Please, Sign In to add comment