mirror of
https://codeberg.org/DansLeRuSH/c-plus-plus-exercises.git
synced 2024-11-21 11:18:07 +00:00
40 lines
473 B
C++
40 lines
473 B
C++
// Auteur : Franck ALBARET
|
|
#include <stdio.h>
|
|
|
|
void compteur (int hh, int mm, int ss)
|
|
{
|
|
ss=ss+1;
|
|
if (ss>59)
|
|
{
|
|
ss=0;
|
|
mm=mm+1;
|
|
}
|
|
else
|
|
{
|
|
ss=ss+1;
|
|
}
|
|
if (mm>59)
|
|
{
|
|
mm=0;
|
|
hh=hh+1;
|
|
}
|
|
else
|
|
{
|
|
mm=mm+1;
|
|
}
|
|
if (hh>23)
|
|
{
|
|
hh=0;
|
|
}
|
|
else
|
|
{
|
|
hh=hh+1;
|
|
}
|
|
printf ("L'heure actuelle est %02i:%02i:%02i\n",hh,mm,ss);
|
|
}
|
|
|
|
int main (void)
|
|
{
|
|
compteur (23,59,59);
|
|
return 0;
|
|
}
|