Skip to content

Instantly share code, notes, and snippets.

@miraishi
Created March 9, 2016 14:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miraishi/51e03713bc84223844f3 to your computer and use it in GitHub Desktop.
Save miraishi/51e03713bc84223844f3 to your computer and use it in GitHub Desktop.
#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