回复 5楼 WDMfans
错,入门容易,学深难……
一步一个脚印...............................默默地前进.....
诚邀乐于解答c菜鸟问题,的热心网友加入, QQ群38490319
#include<stdio.h> struct a { int x; int y; int z; }date; int main() { int days(); printf("input:year month day\n"); scanf("%d%d%d",&date.x,&date.y,&date.z); printf("is the%dth\n",days()); return 1; } int days() { int i = 0; switch(date.y) { case 1:i = date.z;break; case 2:i = date.z+31;break; case 3:i = date.z+59;break; case 4:i = date.z+90;break; case 5:i = date.z+120;break; case 6:i = date.z+151;break; case 7:i = date.z+181;break; case 8:i = date.z+212;break; case 9:i = date.z+243;break; case 10:i = date.z+273;break; case 11:i = date.z+304;break; case 12:i = date.z+334;break; } if((date.x%4==0&&date.x%100!=0||date.x%400==0)&&date.y>=3) i += 1; return i; }楼主注意程序格式,语法方面,我想信楼主自己可以解决的