私の質問はこれです、私は現在、3つの可能な答えを持っています:はい、いいえ、それ以外はすべてです。私のプログラムで「Pardon me?」と書いて欲しい。はい、いいえと答えるまでは...私はC#を使っていて、まだ学んでいるので、できるだけシンプルで新しいです。あなたはc#使用するループ
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Pitalica
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Kvisko");
Console.WriteLine("\"Hello Traveller!!\" says a man. \"What's your name?\"");
string playerName = Console.ReadLine();
Console.WriteLine("\"Hi " + playerName + ", welcome to the beautiful city of Osijek!\nI would like to give you a tour of our little town, but I don't have time to do so right now.\nI need to go to class.\"");
Console.WriteLine("He looks at you with your backpack on your back.\"But I could show you later if you're up to?\"");
string answer1 = Console.ReadLine();
if (answer1 == "yes")
Console.WriteLine("\"We have a deal, " + playerName + "!\"");
else if (answer1 == "no")
Console.WriteLine("\"Your loss," + playerName + "...\"");
else
{
Console.WriteLine("Pardon me?");
}
Console.WriteLine("After some time...");
}
}
}
「しばらくして...」あなたの質問に対する答え。 – Hogan
私はまだ学んでいるから:しばらくしてから...人がはいと答える場合のみ...彼らがいいえ答えたら私はただあなたの敗北を言い、プログラムを終了したい。 – Osti991