Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdlib>
- #include <iostream>
- #include <time.h>
- using namespace std;
- int lpol = 1;
- int pos;
- int rnd;
- int Nrzutu = 0;
- bool meta;
- main()
- {
- srand(time(NULL));
- while(meta==false)
- {
- //rand()%(b-a+1)+a
- Nrzutu++;
- rnd = rand()%4 + 6;
- cout << "wylosowano: " << rnd << endl;
- lpol = lpol + rnd;
- cout << "w rzucie: " << Nrzutu << endl;
- cout << "jest na polu: " << lpol << endl;
- if (lpol >= 100)
- {
- cout << "ukonczono po " << Nrzutu << " rzutach" << endl;
- meta = true;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement