#include <iostream>
#include <stdlib.h>
#include <time.h>
class CDice
{
public:
CDice() { srand(time(NULL)); };
int RollDice();
private:
m_nDice1, m_nDice2, m_nSum;
};
int CDice::RollDice()
{
m_nDice1 = 1 + (rand() % 6);
m_nDice2 = 1 + (rand() % 6);
m_nSum = m_nDice1 + m_nDice2;
std::count << "サイコロを振った。出た目は " << m_nDice1 < " + " << m_nDice2 << " = " << m_nSum << std::endl;
return m_nSum;
}
int main()
{
CDice Dice;
int nSum, nMyPoint;

while(true) {
nSum = Dice.RollDice();
if(nSum == 7 || nSum == 11) { std::cout << "WIN" << std::endl; break; }
else if(nSum == 2 || nSum == 3 || nSum == 12) { std::count << "LOST" << std::endl; break; }
else { std::count << "もう一度!" << std::endl; }
}
return 0;
}