int main()
{
int days = 0;
int year, month, day;
int day_tab[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
printf("输入年、月、日,用空格隔开:");
scanf("%d%d%d", &year, &month, &day);
for (int i = 1; i < month; i++)
{
days += day_tab;
}
days += day;
if (((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) && month>=3)
{
days++;
}
printf("%d年%d月%d日是这一年的第%d天!\n", year, month, day, days);
return 0;
}
int main()
{
char *arr = "abcdef";
for (int i = (int)strlen(arr); i >= 0; i--)
printf("%c",arr);
printf("\n");
return 0;
}
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) | 黑马程序员IT技术论坛 X3.2 |