Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <windows.h>
- #include <iostream>
- #include <iomanip>
- #include <locale>
- #include <string>
- #include <string.h>
- #include <ctime>
- #include <cmath>>
- using namespace std;
- ////////////////////
- struct BonesPlay
- {
- int fBones;
- int sBones;
- int Ebons;
- }fPlay, sPlay;
- ////////////////////
- int main()
- {
- setlocale(LC_CTYPE, "rus");
- SetConsoleOutputCP(1251);
- SetConsoleCP(1251);
- string sss; int result; string a;
- NEWGAME:
- srand (time(NULL));
- cout<<"Первый игрок бросает кости нажатием клавиши [ENTER] "<<endl;
- cin.get();
- fPlay.fBones= rand()%6+1; fPlay.sBones= rand()%6+1;
- fPlay.Ebons= fPlay.fBones + fPlay.sBones;
- cout<<"Первая кость "<< fPlay.fBones<< endl;
- cout<<"Вторая кость "<< fPlay.sBones<< endl;
- cout<<endl<<"Второй игрок бросает кости нажатием клавиши [ENTER] "<<endl;
- cin.get();
- sPlay.fBones= rand()%6+1; sPlay.sBones= rand()%6+1;
- sPlay.Ebons= sPlay.fBones + sPlay.sBones;
- cout<<"Первая кость "<< sPlay.fBones<< endl;
- cout<<"Вторая кость "<< sPlay.sBones<< endl;
- result= fPlay.Ebons - sPlay.Ebons;
- cout<<endl;
- sss= "Ничья...";
- if (result<0) sss= "Второй выиграл!";
- if(result>0) sss= "Победил Первый!";
- cout<< sss<<endl;
- cout<<"Продолжим ? [у] - ДА иначе стоп"; cin>>a;
- cout<<endl;
- if (a=="y") goto NEWGAME;
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement