From Left to The Right - яко зациклих, ако някой има идея, нека ми сподели...
using System;
namespace FromLefttoTheRight
{
class MainClass
{
public static void Main(string[] args)
{
int n = int.Parse(Console.ReadLine());
int sumOfLeftNumber = 0;
int sumOfRightNumber = 0;
int leftNumber = 0;
int rightNumber = 0;
for (int i = 0; i < n; i++)
{
string input = Console.ReadLine();
for (int k = 0; k < input.Length; k++)
{
char current = char.Parse(input[k].ToString());
int digit = 0;
if (current != 32)
{
digit = (int)(current - '0');
rightNumber = int.Parse(rightNumber.ToString() + digit.ToString());
}
else
{
leftNumber = rightNumber;
rightNumber = 0;
}
}
string lN = leftNumber.ToString();
for (int j = 0; j < lN.Length; j++)
{
int leftdigit = int.Parse(lN[j].ToString());
sumOfLeftNumber += leftdigit;
}
string cN = rightNumber.ToString();
for (int m = 0; m < cN.Length; m++)
{
int rightdigit = int.Parse(cN[m].ToString());
sumOfRightNumber += rightdigit;
}
}
if (leftNumber > rightNumber)
{
Console.WriteLine(sumOfLeftNumber);
}
else
{
Console.WriteLine(sumOfRightNumber);
}
}
}
}