#include <iostream>
using namespace std;
int main()
{
char operation;
string choice;
int ans1;
cout<<"What is the answer of (2A+B)^2 when a=3, b=5? \n1 - 120 \n2 - 121 \n3 - 122 \n4 - 123 \n5 - 124";
cin>>operation;
switch (operation)
{
case '1' :
choice = "120";
break;
case '2' :
choice = "121";
break;
case '3' :
choice = "122";
break;
case '4' :
choice = "123";
break;
default:
choice = "Invaild";
}
cout<<"Your answer is "<<choice<<" ";
{
if (BlahBlah)
ans1=correct;
else
ans1=wrong;
}
cout<<"Your answer is "<<ans1;
return 0;
}
여기에서 2번을 고르면 답이 맞다고 출력하고 2번 외에는 답이 아니라고 출력하고 싶은데 어떻게 해야하나요?
댓글 0