Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <windows.h>
- #include <cstring>
- #include <time.h>
- #include <stdio.h>
- #include <stdlib.h>
- using namespace std;
- int main()
- {
- int hour, coeff=90;
- char minut;
- srand (time (NULL));
- for(hour=0; hour<=24; hour= hour+4)
- {
- switch (hour){
- case 0:
- if (coeff<rand () % 100 + 1)
- cout<<"game over";
- else
- coeff=coeff-5;
- break;
- case 4:
- if (coeff<rand () % 100 + 1)
- cout<<"game over";
- else
- coeff=coeff-5;
- break;
- case 8:
- if (coeff<rand () % 100 + 1)
- cout<<"game over";
- else
- coeff=coeff-5;
- break;
- case 12:
- if (coeff<rand () % 100 + 1)
- cout<<"game over";
- else
- coeff=coeff-5;
- break;
- case 16:
- if (coeff<rand () % 100 + 1)
- cout<<"game over";
- else
- coeff=coeff-5;
- break;
- case 20:
- if (coeff<rand () % 100 + 1)
- cout<<"game over";
- else
- coeff=coeff-5;
- break;
- case 24:
- if (coeff<rand () % 100 + 1)
- cout<<"game over";
- else
- coeff=coeff-5;
- break;
- default: cerr << "error\n";
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement