| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 
 |  
#include <stdio.h>
#include <stdlib.h>
 
typedef struct
{
    int heure, minute, seconde;
 
}
temps;
 
 
entree(temps *t)
{
 
t->heure=99;
t->minute=99;
t->seconde=99;
 
while ((t->heure<0)||(t->heure>23))
{
    printf("entré les heures : ");
    scanf ("%i",&t->heure);
    if ((t->heure<0)||(t->heure>23))
    {
        printf ("temps invalide... veuillez recommencer\n");
    }
}
 
while ((t->minute<0)||(t->minute>59))
{
    printf("entré les minute : ");
    scanf ("%i",&t->minute);
    if ((t->minute<0)||(t->minute>59))
    {
        printf ("temps invalide... veuillez recommencer\n");
    }
}
 
    while ((t->seconde<0)||(t->seconde>59))
    {
        printf("entré les seconde : ");
        scanf ("%i",&t->seconde);
        if ((t->seconde<0)||(t->seconde>59))
        {
            printf ("temps invalide... veuillez recommencer\n");
        }
}
}
 
sortie(temps *t)
{
printf ("le temps est %i:%i:%i\n",t->heure,t->minute,t->seconde);
}
 
int main()
{
    temps t;
    entree (&t);
    sortie (&t);
} |