Advertisement
Guest User

Untitled

a guest
Jan 17th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.90 KB | None | 0 0
  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. int cycle_1;
  8. int cycle_2;
  9. int cycle_3;
  10. int cycle_4;
  11. int cycle_5;
  12. int cycle_6;
  13.  
  14. int occurance = 0;
  15.  
  16.  
  17. int pinAttempt[4];
  18. int TotalTime = 0;
  19.  
  20. for( cycle_1 = 0; cycle_1 <10; cycle_1 = cycle_1 + 1)
  21. {
  22.     for( cycle_2 = 0; cycle_2 <10; cycle_2 = cycle_2 + 1)
  23.     {
  24.         for( cycle_3 = 0; cycle_3 <10; cycle_3 = cycle_3 + 1)
  25.         {
  26.             for( cycle_4 = 0; cycle_4 <10; cycle_4 = cycle_4 + 1)
  27.             {
  28.                 pinAttempt[0] = cycle_1;
  29.                 pinAttempt[1] = cycle_2;
  30.                 pinAttempt[2] = cycle_3;
  31.                 pinAttempt[3] = cycle_4;
  32.                 for ( cycle_5 = 0; cycle_5 <4; cycle_55 = cycle_5 + 1 )
  33.                 {
  34.                     for( cycle_6 = cycle_5 + 1; cycle_6 <3; cycle_6 = cycle_6 + 1 )
  35.                     {
  36.                         if(pinAttempt[cycle_5]==pinAttempt[Cycle_6})
  37.                             {
  38.                                 occurance = occurance+1;
  39.                             }
  40.                     }
  41.                     if(occurance < 3)
  42.                     {
  43.                         TotalTime = TotalTime + 4;
  44.                     }
  45.                     occurance = 0;
  46.  
  47.                 }
  48.             }
  49.         }
  50.     }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement