Объяснение:
using System;
class Program
{
static int P(string p)
int a = 0, dec = 1;
for (int i = p.Length - 1; i >= 0; i--)
a += (p[i] - '0') * dec;
dec *= 10;
}
return a;
static void Main(string[] args)
int minSum = 1000000000, maxSum = 0, itMin = 0, itMax = 0;
for (int i = 0; i < 10; i++)
int nowSum = 0;
string a = Console.ReadLine();
string[] now = a.Split(' ');
for (int j = 0; j < now.Length; j++)
int n = P(now[j]);
nowSum += n;
if (minSum > nowSum)
itMin = i;
minSum = nowSum;
if (maxSum < nowSum)
itMax = i;
maxSum = nowSum;
Console.WriteLine("{0} - строка с минимумом, {1} - строка с максимумом", itMin + 1, itMax + 1);
Console.ReadLine();
Объяснение:
using System;
class Program
{
static int P(string p)
{
int a = 0, dec = 1;
for (int i = p.Length - 1; i >= 0; i--)
{
a += (p[i] - '0') * dec;
dec *= 10;
}
return a;
}
static void Main(string[] args)
{
int minSum = 1000000000, maxSum = 0, itMin = 0, itMax = 0;
for (int i = 0; i < 10; i++)
{
int nowSum = 0;
string a = Console.ReadLine();
string[] now = a.Split(' ');
for (int j = 0; j < now.Length; j++)
{
int n = P(now[j]);
nowSum += n;
}
if (minSum > nowSum)
{
itMin = i;
minSum = nowSum;
}
if (maxSum < nowSum)
{
itMax = i;
maxSum = nowSum;
}
}
Console.WriteLine("{0} - строка с минимумом, {1} - строка с максимумом", itMin + 1, itMax + 1);
Console.ReadLine();
}
}