如题,调试的时候,到第一个IF就直接跳过IF判断,直接就输出到了末尾Console.ReadLine();
Console.WriteLine("脑经急转弯有奖答题现在开始!");
Console.WriteLine("请选题:1或者2");
string oneAnswers = Console.ReadLine();
string title = ( oneAnswers == "1") ? "锅盖翻一面是什么?":"与家人相反的是什么?";
Console.WriteLine("你选择:第{0}题!请听题,{1}。", oneAnswers, title);
string twoAnswers = Console.ReadLine();
if (title == "1")
{
if (twoAnswers == 盖锅)
{
Console.WriteLine("恭喜你,回答正确,请从四个礼物盒中选择一个!");
string[] awards = new string[] { "火腿肠", "辣条", "巧克力", "棒棒糖" };
for (int i = 0; i < awards.Length; i++)
{
Console.WriteLine("您选择了{0}号礼物盒,恭喜您获得了" + awards[i] + "一份。");
break;
}
}
}
Console.ReadLine();
额,我只做了第一小节,但是调试的时候调试不走,没心情继续做了,纠结了半天
求指教!!!
Console.WriteLine("脑经急转弯有奖答题现在开始!");
Console.WriteLine("请选题:1或者2");
string oneAnswers = Console.ReadLine();
string title = ( oneAnswers == "1") ? "锅盖翻一面是什么?":"与家人相反的是什么?";
Console.WriteLine("你选择:第{0}题!请听题,{1}。", oneAnswers, title);
string twoAnswers = Console.ReadLine();
if (title == "1")
{
if (twoAnswers == 盖锅)
{
Console.WriteLine("恭喜你,回答正确,请从四个礼物盒中选择一个!");
string[] awards = new string[] { "火腿肠", "辣条", "巧克力", "棒棒糖" };
for (int i = 0; i < awards.Length; i++)
{
Console.WriteLine("您选择了{0}号礼物盒,恭喜您获得了" + awards[i] + "一份。");
break;
}
}
}
Console.ReadLine();
额,我只做了第一小节,但是调试的时候调试不走,没心情继续做了,纠结了半天
求指教!!!