[C] curieux !!!!!
Farid1
Messages postés
546
Statut
Membre
-
sebsauvage Messages postés 33284 Date d'inscription Statut Modérateur Dernière intervention -
sebsauvage Messages postés 33284 Date d'inscription Statut Modérateur Dernière intervention -
salut voila un code C mais ou le mettre dans kel logiciel ?
#include <stdio.h>
int main(int argc, char * argv[])
{
long long x = 0;
int s = 0;
int m = 0;
int h = 0;
long j = 0;
char date[50];
int t = 0;
long long tl = 0;
printf("nombres de secondes : ");
scanf("%d",&x);
s = x % 60;
tl = (x - s) / 60;
t = tl % 60;
tl = (tl - t) / 60;
m = t;
h = tl % 24;
j = (tl - h) / 24;
sprintf(date,"%8ld jours %2d heures %2d minutes et %2d secondes\n", j, h, m, s);
puts(date);
system("pause");
return 0;
}
et merci
#include <stdio.h>
int main(int argc, char * argv[])
{
long long x = 0;
int s = 0;
int m = 0;
int h = 0;
long j = 0;
char date[50];
int t = 0;
long long tl = 0;
printf("nombres de secondes : ");
scanf("%d",&x);
s = x % 60;
tl = (x - s) / 60;
t = tl % 60;
tl = (tl - t) / 60;
m = t;
h = tl % 24;
j = (tl - h) / 24;
sprintf(date,"%8ld jours %2d heures %2d minutes et %2d secondes\n", j, h, m, s);
puts(date);
system("pause");
return 0;
}
et merci
1 réponse
-
Il te faut un compilateur C.
En voilà des gratuits:
http://www.thefreecountry.com/compilers/cpp.shtml