2022-04-10 22:33来源:m.sf1369.com作者:宇宇
公共英语考试不太清楚。但计算机网络技术可以帮你一下。
考计算机网络技术需要三本书分别是
全国计算机等级考试 网络技术 出版社注意是高等教育出版社
C语言 谭浩强出版的
还有南开100题。可以在网上找到。(上机主要考点都在南开100题里)
给你一个,我自己编的:
#include stdio.h
int _judge(int x)
{
if(x%400==0)
return(1);
else if(x%4==0&&x%100!=0)
return(1);
else return(0);
}
int _fun(int year,int month,int day)
{
int i,sum=0,a[12]={31,29,31,30,31,30,31,31,30,31,30,31};
if(_judge(year)==1)
{
for(i=0;i<month-1;i++)sum+=a[i];
sum+=day;
}
else
{
a[1]=28;
for(i=0;i<month-1;i++)sum+=a[i];
sum+=day;
}
return(sum);
}
void main()
{
int year,month,day;
printf(Please input the year,month and day:\n);
scanf(%d,%d,%d,&year,&month,&day);
printf(The %dth day in the %dth month of the year %d ,day,month,year);
printf(is the %dth day of this year.\n,_fun(year,month,day));
}
主要是要分闰年平年。所以有一个判断。