~cpp 내가 방(난것 같...ㅡㅡ;;) #include<iostream> #include<stdlib.h> #include<time.h> using namespace std; void main() { double money=1000; double beting; int num; int sq1,sq2; while(money>=10) { cout << "당 $" << money << " 다." << endl << "배 ($10~$100) : $"; cin >> beting; if(money<beting) { cout << "당 보다 많다. 다 배 ." <<endl; continue; } if(beting >100 || beting <10) { cout << "$10~$100 로 력 ." << endl; continue; } money-=beting; cout << "당 배 $" << beting <<" 다." << endl << "디 겠까?" << endl << "|----------------------------------|" <<endl << "| Number | 배 | |" <<endl << "|--------+------------+------------|" <<endl << "| 1 | 2 or 12 | 5:1 |" <<endl << "| 2 | 4 or 10 | 2.5:1 |" <<endl << "| 3 | 6 or 8 | 1.5:1 |" <<endl << "|----------------------------------|" <<endl <<"배 곳? (1 ~ 3) : "; cin >> num; while(num!=1 && num!=2 && num!=3) { cout << "1 ~ 3 범 내 력 : "; cin >> num; } srand (time (NULL)); sq1 = rand()%6; sq1++; sq2 = rand()%6; sq2++; cout << num <<" 다. 그럼 게 다." <<endl << " 는 :" << sq1 << endl << "두 는 :" << sq2 << endl << "두 : " << sq1+sq2 <<endl; if((sq1+sq2)%2==0) { switch(num) { case 1: if((sq1+sq2)==2 || (sq1+sq2)==12) { beting*=5; cout << "당 리다." <<endl <<"$" << money << " + "<<"$" <<beting<< " = $" << money+beting; money+=beting; } else { cout << "당 배다."<<endl; } break; case 2: if((sq1+sq2)==4 || (sq1+sq2)==10) { beting*=2.5; cout << "당 리다." <<endl <<"$" << money << " + "<<"$" <<beting<< " = $" << money+beting; money+=beting; } else { cout << "당 배다."<<endl; } break; case 3: if((sq1+sq2)==6 || (sq1+sq2)==8) { beting*=1.5; cout << "당 리다." <<endl <<"$" << money << " + "<<"$" <<beting<< " = $" << money+beting; money+=beting; } else { cout <<"당 배다."<<endl; } break; default: cout << "당 배다."<<endl; break; } } else cout <<"당 배다." <<endl; } cout << " 모두 다." <<endl; }