Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
#include<stdio.h>
#include<stdlib.h>
struct today{
int year;
int month;
int day;
};typedef struct today TODAY;
void aisatsu(int,int,int);
int main() {
TODAY today;
printf("今日の日付を入力してください。\n year:");
scanf("%d",&today.year);
printf("month:");
scanf("%d",&today.month);
printf("day:");
scanf("%d",&today.day);
aisatsu(today.year,today.month,today.day);
return 0;
}
void aisatsu(int year,int month, int day){
if(year==2016)
printf("明けましておめでとうございます。\n");
else{
printf("年が違うやん\n");
exit(EXIT_FAILURE);
}
if(month!=1){
printf("届くの、めっちゃ遅いやん。\n");
exit(EXIT_FAILURE);
}
if(day==1){
printf("今年もよろしくお願いします。\n");
}
else if(day<4){
printf("こ、今年もよろしくお願いします。。。\n届くの遅くなって申し訳ない。\n");
}
else{
printf("ちゃうねん、年末色々と忙しかってん。\n");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment