Problemy z Console.Read () i Console.ReadLine ()
Próbowałem użyć Console.Read () i Console.ReadLine () w C #, ale otrzymałem dziwne wyniki. na przykład ten kod
Console.WriteLine("How many students would you like to enter?");
int amount = Console.Read();
Console.WriteLine("{0} {1}", "amount equals", amount);
for (int i=0; i < amount; i++)
{
Console.WriteLine("Input the name of a student");
String StudentName = Console.ReadLine();
Console.WriteLine("the Students name is " + StudentName);
}
daje mi tę kwotę = 49, gdy wprowadzam 1 dla liczby uczniów, a ja nawet nie dostaję szansy na wpisanie imienia ucznia.