TOPIC
Erro Runtime em C#, não sei o que esta errado :)
rqueiros0 asked 2 years ago
Alguém pode me ajudar a encontrar o erro ? obrigado!
RUNTIME ERROR
using System;
namespace _1061 { class Program { static void Main(string[] args) { int dia1, hora1, segu1, min1, dia2, hora2, segu2, min2, w, x, y, z, d1, d2, tempo; string[] vet;
Console.Write("Dia ");
dia1 = int.Parse (Console.ReadLine());
vet = Console.ReadLine().Split(':');
hora1 = int.Parse(vet[0]);
min1 = int.Parse(vet[1]);
segu1 = int.Parse(vet[2]);
Console.Write("Dia ");
dia2 = int.Parse(Console.ReadLine());
vet = Console.ReadLine().Split(':');
hora2 = int.Parse(vet[0]);
min2 = int.Parse(vet[1]);
segu2 = int.Parse(vet[2]);
d1 = (segu1 + min1 * 60) + (hora1 * 60 * 60) + (dia1 * 60 * 60 * 24);
d2 = (segu2 + min2 * 60) + (hora2 * 60 * 60) + (dia2 * 60 * 60 * 24);
tempo = d2 - d1;
w = tempo / (60 * 60 * 24);
tempo = tempo % (60 * 60 * 24);
x = tempo / (60 * 60);
tempo = tempo % (60 * 60);
y = tempo / 60;
z = tempo % 60;
Console.WriteLine(w + " dia(s)");
Console.WriteLine(x + " hora(s)");
Console.WriteLine(y + " minuto(s)");
Console.WriteLine(z + " segundo(s)");
}
}
}