Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <time.h>
- #include <windows.h>
- #include <conio.h>
- using namespace std;
- int main()
- {
- srand(time(NULL));
- int tab[10];
- int number=0;
- int number2=0;
- int xx=0;
- char www;
- bool bol=false;
- while(bol != true)
- {
- int z = 0;
- system("cls");
- for(int i=1; i<=10; i++)
- {
- tab[i]=i;
- number=rand()%10+1;
- number2=rand()%6;
- if(i%number==number2)
- {
- cout<<"["<<tab[i]<<"] ";
- z += tab[i];
- }
- else
- cout << tab[i]<<" ";
- }
- xx+=z;
- cout <<endl<<"hits: "<<z<<"|||Your points: "<<xx;
- cout << "\nprint any key to Continue...";
- Sleep(100);
- www=getch();
- cout << www;
- if(xx >= 1000)
- {
- bol=true;
- }
- }
- if(bol == true)
- {
- system("cls");
- cout << "YOU WINNER!\n";
- cout << "YOUR SCORE: "<<xx<<endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement