elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Guía actualizada para evitar que un ransomware ataque tu empresa


  Mostrar Temas
Páginas: [1]
1  Programación / Programación C/C++ / Iniciar, Pausar, Reiniciar un cronometro en c++ en: 13 Marzo 2015, 23:02 pm
Esto es solo el cronometro pero he intentado hacerlo las funciones y nomas no se me dan, no he podido asignar estas funciones a teclas...


#include <iostream>
#include <time.h>
#include <conio.h>
#include <cstdlib>
using namespace std;


void delay (double seconds)
{
    clock_t endwait;
    endwait = clock() + seconds * CLOCKS_PER_SEC;
    while (clock() < endwait) {}
}

int main()
{
    int hr, mn, sg, cs, hr1, mn1, sg1, cs1;




    for (hr=0; hr<=2; hr++)
    {
        for (hr1=0; hr1<=9; hr1++)
        {
            for (mn=0; mn<=5; mn++)
            {
                for (mn1=0; mn1<=9; mn1++)
                {
                    for (sg=0; sg<=5; sg++)
                    {
                        for (sg1=0; sg1<=9; sg1++)
                        {
                            for (cs=0; cs<60; cs++)
                            {
                                cout<<"------> CHRONOMETER <------"<<endl<<endl;

                                cout<<hr<<hr1<<":"<<mn<<mn1<<":"<<sg<<sg1<<":"<<cs;
                                delay(0.01);
                                system ("cls");

                            }
                        }
                    }
                }
            }
        }

    }

    return 0;
}
2  Programación / Programación C/C++ / Crear cronometro en c++ usando "for" en: 12 Marzo 2015, 05:32 am
Como crear un programa que simule a un cronometro con el formato HH:MM:SS:MS y que tenga las acciones Iniciar, Pausar, Reiniciar y Salir. Todo esto utilizando for
Páginas: [1]
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines