46 lines
832 B
C
46 lines
832 B
C
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <time.h>
|
|
int main(int argc, char const *argv[]){
|
|
int date;
|
|
int mois;
|
|
int annee;
|
|
printf("Entrez une date : ");
|
|
scanf("%d", &date);
|
|
scanf("%d", &mois);
|
|
scanf("%d", &annee);
|
|
struct tm jour;
|
|
jour.tm_sec = 0;
|
|
jour.tm_min = 0;
|
|
jour.tm_hour = 0;
|
|
jour.tm_mday = date;
|
|
jour.tm_mon = mois;
|
|
jour.tm_year = annee;
|
|
printf("%d\n", jour.tm_wday);
|
|
if (jour.tm_wday == 0){
|
|
printf("c'est un dimanche");
|
|
}
|
|
if (jour.tm_wday == 1){
|
|
printf("c'est un lundi");
|
|
}
|
|
if (jour.tm_wday == 2){
|
|
printf("c'est un mardi");
|
|
}
|
|
if (jour.tm_wday == 3){
|
|
printf("c'est un mercredi");
|
|
}
|
|
if (jour.tm_wday == 4){
|
|
printf("c'est un jeudi");
|
|
}
|
|
if (jour.tm_wday == 5){
|
|
printf("c'est un vendredi");
|
|
}
|
|
if (jour.tm_wday == 6){
|
|
printf("c'est un samedi");
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
} |