i'm making a code and i'm new to c++ can i get ann example of how to get my code to prefect the objective. here is my game's code
include
include
using namespace std;
int main(int argc, char *argv(void)) { std::cout << "what is 10 + 10?" << std::endl;
std::cout << "20" << std::endl;
std::cout << "70" << std::endl;
std::cout << "100" << std::endl;
std::cout << "10000" << std::endl;
std::cout << "10000000" << std::endl;
int choice;
cin >> choice;
switch (choice) {
case 20:
cout << "correct!" << endl;
break;
case 70:
cout << "try again!" << endl;
break;
case 100:
cout << "try again!" << endl;
break;
case 10000:
cout << "try again!" << endl;
break;
case 10000000:
cout << "try again!" << endl;
break;
default:
cout << "unknown type" << endl;
}
system("PAUSE");
return 0;
}
please help
Aucun commentaire:
Enregistrer un commentaire