0
저는 C#에 익숙하지 않습니다. 같은 문제가있는 다른 게시물을 검색 한 후 많은 도움을받을 수 없었습니다. 디버깅 할 때마다 문구가 다르지만 매번 다른 문구가 아닌 동일한 문구가 반복됩니다.프레이즈 생성기가 같은 문구를 계속 반복합니다.
using System;
public class Program
{
static String[] nouns = new String[3] { "He", "She", "It" };
static String[] adjectives = new String[5] { "loudly", "quickly", "poorly", "greatly", "wisely" };
static String[] verbs = new String[5] { "climbed", "danced", "cried", "flew", "died" };
static Random rnd = new Random();
static int noun = rnd.Next(0, nouns.Length);
static int adjective = rnd.Next(0, adjectives.Length);
static int verb = rnd.Next(0, verbs.Length);
static void Main()
{
for (int rep = 0; rep < 5; rep++)
{
Console.WriteLine("{0} {1} {2}", nouns[noun], adjectives[adjective], verbs[verb]);
}
}
}