07.Name Wars
Дава ми 100/100.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace _07.Name_Wars
{
class Program
{
static void Main(string[] args)
{
int current = 0;
int max = 0;
string namemax = "";
int max1 = int.MinValue;
while(true)
{
string name = Console.ReadLine();
if (name == "STOP")
break;
for (int i = 0; i < name.Length; i++)
current = current + name[i];
if (current > max1 && current>max)
{
max = current;
namemax = name;
current = 0;
}
current = 0;
}
Console.WriteLine($"Winner is {namemax} - {max}!");
}
}
}