题目:某年某月某日是该年的第几天
#include<stdio.h>
#include<stdlib.h>int day_of_year(int m,int d,int y);
int main()
{
int a,b,c;
printf("Enter month day year: \n");
scanf("%d %d %d",&a,&b,&c);
int result=day_of_year(a,b,c);
printf("%d\n",result);
system("pause");
return 0;
}
int day_of_year(int m,int d,int y){
int t;
if(m<=2){
t=(m-1)*30+d;
}
else if(m>2)t=(m-2)*30+28+d;
return t;
}