mhdew

Case Generator

Mar 21st, 2018
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2.  
  3. using namespace std;
  4. #define in() freopen("Input_tc.txt", "r", stdin)
  5. #define out() freopen("Input.txt", "w", stdout)
  6.  
  7. void yes_1()
  8. {
  9.     printf("%02d%c%02d\n", rand()%8,':', rand()%60);
  10. }
  11.  
  12. void yes_2()
  13. {
  14.     printf("%02d%c%02d\n", rand()%9,':', rand()%30);
  15. }
  16.  
  17. void no()
  18. {
  19.     for(;;){
  20.         int h=rand()%24;
  21.         int m=rand()%60;
  22.         if(h>=9){
  23.             printf("%02d%c%02d\n", h,':',m);
  24.             break;
  25.         }
  26.     }
  27. }
  28.  
  29. int main()
  30. {
  31.     out();
  32.     printf("100\n");
  33.     cout<<endl;
  34.     for(int i=0;i<25;i++) yes_1();
  35.     for(int i=0;i<25;i++) yes_2();
  36.     for(int i=0;i<50;i++) no();
  37.  
  38.     return 0;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment