【发布时间】:2017-12-27 20:58:54
【问题描述】:
我想在我的两个函数中使用int balance 和cPercent 等等。我该怎么做?
link to pastebin。和代码:
int main()
{
int balance = 100;
int cPercent;
float bet;
float thirty = 1.3;
int outcome;
std::cout << "Welcome!\n";
std::cout << "\nYour balance is currently: " << balance << "$\n";
std::cout << "Would you like to have 50% or 30% or 70% chance percent of winning?\n";
std::cout << "Type 1 for 30%, 2 for 50% and 3 for 70%";
std::cin >> cPercent;
while(1){}
}
void gamble()
{
int gPercent = (rand() % 10);
if (cPercent = 1) {
if (gPercent < 3) {
outcome = floor(bet * thirty);
}
else if (cPercent = 2) {
}
}
}
【问题讨论】:
标签: javascript needle.js