Created
March 9, 2016 14:30
-
-
Save miraishi/51e03713bc84223844f3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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