Дата активности | Консольный раздел | Прогресс | ||
---|---|---|---|---|
2019-07-30 | book | 000. Строки | 63 % | |
Итого: | 63 % |
Попробуй подключить using System.Text; для StringBuilder
StringBuilder text =new StringBuilder(Console.ReadLine());
text.Replace(",", "");
text.Replace(".", "");
text.Replace("!", "");
text.Replace("?", "");
string text1 = text.ToString();
string[] words = text1.Split(new char[] { ' ' });
string w1 = words[0];
string w2 = words[1];
string w3 = words[2];
string w4 = words[3];
string w5 = words[4];
string q1;
if(w1.Length > w2.Length)
{
q1 = w1;
}
else
{
q1 = w2;
}
string q2;
if( w3.Length > w4.Length)
{
q2 = w3;
}else
{
q2 = w4;
}
if (q1.Length > q2.Length)
{
if(q1.Length > w5.Length)
{
Console.WriteLine(q1.Length);
}
else
{
Console.WriteLine(w5.Length);
}
}
else
{
if(q2.Length > w5.Length)
{
Console.WriteLine(q2.Length);
}
else
{
Console.WriteLine(w2.Length);
}
}
ето праграма чотко работаэт на visual studio а ваш робот не может ее кампилироват