SHOW:
|
|
- or go back to the newest paste.
| 1 | #include <stdio.h> | |
| 2 | #include <stdlib.h> | |
| 3 | - | #include <math.h> |
| 3 | + | #include <unistd.h> |
| 4 | - | #include <time.h> |
| 4 | + | |
| 5 | - | |
| 5 | + | |
| 6 | {
| |
| 7 | // Variabili | |
| 8 | - | // Hours, minutes and seconds |
| 8 | + | |
| 9 | int mm; | |
| 10 | int ss; | |
| 11 | ||
| 12 | // Iniziamo dall'alba | |
| 13 | - | // Rise and shine, Mr. Clock |
| 13 | + | |
| 14 | mm = 0; | |
| 15 | ss = 0; | |
| 16 | ||
| 17 | // Un orologio va sempre... | |
| 18 | - | // A clock always works |
| 18 | + | |
| 19 | while(hh < 24) {
| |
| 20 | while(mm < 60) {
| |
| 21 | - | while(mm < 60) {
|
| 21 | + | while(ss < 60) {
|
| 22 | - | while(ss < 60) {
|
| 22 | + | printf("%d : %d : %d \tClose with Ctrl+C\r", hh, mm, ss);
|
| 23 | - | sleep(1); |
| 23 | + | fflush(stdout); |
| 24 | - | ss++; |
| 24 | + | sleep(1); |
| 25 | - | |
| 25 | + | ss++; |
| 26 | - | // What time is it? |
| 26 | + | } |
| 27 | - | printf("%d : %d : %d \t\t Close with Ctrl+C \r", hh, mm, ss);
|
| 27 | + | mm++; |
| 28 | - | } |
| 28 | + | ss = 0; |
| 29 | - | mm++; |
| 29 | + | } |
| 30 | - | ss = 0; |
| 30 | + | |
| 31 | mm = 0; | |
| 32 | } | |
| 33 | hh = 0; | |
| 34 | } | |
| 35 | ||
| 36 | } |