博科园AI人工智能助手
图灵
hi 人类
#include <stdio.h> void month_day(int year,int yearday,int *pmonth,int *pday); int main(void) { int day,yearday,month,year; scanf(“%d %d”,&year,&yearday); month_day(year,yearday,&month,&day); printf(“%d-%d-%d”,year,month,day); return 0;} void month_day(int year,int yearday,int *pmonth,int *pday) { int k,leap; int a[2][13]={{0,31,28,31,30,31,30,31,31,30,31,30,31}, {0,31,29,31,30,31,30,31,31,30,31,30,31},}; leap=(year%4==0&&year0!=0)||year@0==0; for(k=1;yearday>a[leap][k];k ) yearday-=a[leap][k]; *pmonth=k; *pday=yearday; }