Cómo se Compone el Sistema en C++:
- 4 Variables que son : HORAS, MINUTOS, SEGUNDOS y MILI-SEGUNDOS.
- 4 Ciclos For Anidados.
- Por ultimo la Salida en Pantalla que muestra el Cronómetro.
#include <cstdlib> /* Declaramos las librerias iniciales */
#include <iostream>using namespace std;
int main() {
int HORA, MINUTO, SEGUNDO, ML;
for (HORA=0; HORA<1000; HORA++) {
for (MINUTO=0; MINUTO<60; MINUTO++) {
for (SEGUNDO=0; SEGUNDO<60; SEGUNDO++) {
for (ML=0; ML<18.9; ML++) /* Hacemos for que hasta los 18.9 milesimas, en tiempo real serian 100 milesimas */ {
cout << "Cronometro ";
cout << HORA << ":" << MINUTO <<":"<< SEGUNDO << "." << ML << "\n"; system("cls");
}
}
}}
system("PAUSE>NUL"); /* Pausamos el proyecto y cuando hagamos click en cualquier tecla se cerrara */
}