WHY "Runtime error" ????!!!!!!
using System;
class Program
{
static void Main()
{
int N = int.Parse(Console.ReadLine());
if (N > 0 && N <= 100)
{
string[,] IData = new string[N, 3];
string[] buf = new string[2];
for (int i = 0; i < N; i++)
{
buf = Console.ReadLine().Split(' ');
IData[i, 0] = buf[0];
IData[i, 1] = buf[1];
IData[i, 2] = Convert.ToString(i + 1);
}
String[] Win = new string[N];
string[] Lider = new string[2];
Lider = IData[0, 1].Split(':');
int k = 0;
for (int i = 1; i < N+1; i++)
{
buf = IData[i, 1].Split(':');
if (int.Parse(Lider[0]) > int.Parse(buf[0]))
{
if (i == 1 && (60 - double.Parse(buf[1].Replace(".", ",")) + double.Parse(Lider[1].Replace(".", ",")) < 30))
{
Win[k] = IData[0,0];
k++;
}
Win[k] = IData[i, 0];
k++;
Lider = IData[i, 1].Split(':');
}
if (int.Parse(Lider[0]) == int.Parse(buf[0]))
{
if (double.Parse(Lider[1].Replace(".", ",")) > double.Parse(buf[1].Replace(".", ",")))
{
double tmp = double.Parse(Lider[1].Replace(".", ",")) - double.Parse(buf[1].Replace(".", ","));
if (i == 1 && tmp < 30)
{
Win[k] = IData[0, 0];
k++;
}
Win[k] = IData[i, 0];
k++;
Lider = IData[i, 1].Split(':');
}
}
if (int.Parse(Lider[0]) < int.Parse(buf[0]))
{
Win[k] = IData[0, 0];
k++;
}
}
Console.WriteLine(k);
Array.Sort(Win);
for (int i = 0; i < k; i++)
{
Console.WriteLine(Win[i]);
}
}
}
}
Edited by author 12.02.2013 23:07