Está en la página 1de 2

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace CICLITA_N_VUELTAS_TIEMPO

class Program

static void Main(string[] args)

Console.WriteLine("Ciclista N vueltas, tiempo");

Console.WriteLine("===========================");

//declarar variables

int NroEtapas = 0;

int hora, minuto, segundo;

int k = 1;

double HH=0, MM=0, SS=0;

int tiemposegundos, tiempomenor=10000000;

//leer resultados

Console.WriteLine("Ingrese Numero de Etapas");

NroEtapas=int.Parse(Console.ReadLine());

//calcular la vuelta de menor tiempo

for (k = 1; k <= NroEtapas; k = k + 1)

Console.WriteLine("Etapa: " + k + ": ");

Console.Write("Horas: ");

hora = int.Parse(Console.ReadLine());

Console.Write("Minutos: ");

minuto = int.Parse(Console.ReadLine());

Console.Write("Segundos: ");
segundo = int.Parse(Console.ReadLine());

tiemposegundos = hora * 3600 + minuto * 60 + segundo;

if (tiemposegundos < tiempomenor)

tiempomenor = tiemposegundos;

HH = tiempomenor / 3600;

MM = tiempomenor % 3600 / 60;

SS = tiempomenor % 60;

//escribir

Console.WriteLine("El tiempo menor es: " + tiempomenor);

Console.WriteLine("HH: " + HH);

Console.WriteLine("MM: " + MM);

Console.WriteLine("SS: " + SS);

//ejecucion

Console.ReadKey();

También podría gustarte