\rint main ()\r{ int sum_day(int month,int day);\rint lea" /> \rint main ()\r{ int sum_day(int month,int day);\rint lea" />

全文预览

c语言源程序

上传者:业精于勤 |  格式:pdf  |  页数:52 |  大小:2599KB

文档介绍
rconvert(num);\rprintf("\n");\r)\rvoid convert(int n).\rinti;\rif((i=n/10)!=0)\rconvert(i);\rprintf(H%4c,,,n%10+48);\r)\r57. #include<stdio.h>\rint main ()\r{ int sum_day(int month,int day);\rint leap(int year);\rint year,month,day,days;\rprintf("(‘&’&):“)\rscanf("d,%d,%d”,&year,&month,&day);\rdays=sum_day(month,day);\rif(leap(year)&&month>=3)\rdays=days+1;\rprintf("“”\n‘|d •.\n”,days);\rreturn 0;\r}\rint sum_day(int month,int day)\r{int day_tab[13]={0,31,28,31,30,31,30,31,31,30,31,30,31);\rinti;\rfor(i=1;i<month;i++).\rday+=day_tab[i];\rreturn(day);\r}\rint leap(int year)\r{int leap;\rleap=year%4==0&&year%100!=0||year%400==0;\rreturn (leap);\r)

收藏

分享

举报
下载此文档