Помогите найти ошибку! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Помогите найти ошибку!

Писал вчера код для решения задачи о новых правах. И встретил ошибку, решение которой вызывает у меня затруднение. Прошу помощи у обитателей SoloLearn-а и надеюсь, что мне кто-нибудь ответит. Я закомментировал там ошибку с вводом строки. Объясните, пожалуйста, почему ReadLine - можно, а Read - нельзя. P. S. Комментарии, выводящие на экран значение переменных нужны были мне при попытке отладки программы, я не стал их стирать, может быть, они помогут Вам. https://code.sololearn.com/cdwVit4QCQ3i/?ref=app

3rd Jan 2020, 7:14 PM
Матвей Пучков
Матвей Пучков - avatar
4 Answers
+ 2
Console.Read does not return a string without a crlf. Where Console.Write and Console.WriteLine are similar. Printing a string without or with crlf. Console.Read and Console.ReadLine are not. https://www.geeksforgeeks.org/console-read-method-in-c-sharp/ Console.Read returns a integer. public static int Read (); It returns integer value of the next character in the stream. You should use Console.ReadLine Notice that the challenge input is Eric 2 'Adam Caroline Rebecca Frank' So the list of people that are waiting you without is given in one string instead of four. You are doing well!!. Keep asking, Keep coding.
4th Jan 2020, 8:09 PM
sneeze
sneeze - avatar
+ 2
Can you give a link to the code coach challenge ?
4th Jan 2020, 8:08 AM
sneeze
sneeze - avatar
4th Jan 2020, 8:16 AM
Матвей Пучков
Матвей Пучков - avatar
+ 2
Thank you!
4th Jan 2020, 8:17 PM
Матвей Пучков
Матвей Пучков - avatar