作业帮 > 综合 > 作业

usaco 里的Friday the Thirteenth请牛人帮忙

来源:学生作业帮 编辑:搜搜考试网作业帮 分类:综合作业 时间:2024/07/01 11:21:19
usaco 里的Friday the Thirteenth请牛人帮忙
/*
ID:handsom1
PROG:friday
LANG:C++
*/
#include
#include
using namespace std;
int judge(int y)
{
if ((y % 100 && y % 4 == 0 ) || y % 400 == 0 )
return 29;
else return 28;
}
int main()
{
int month[13],day[7],year=1900,n,all=13;
month[1]=month[3]=month[5]=month[7]=month[8]=month[10]=month[12]=31;
month[4]=month[6]=month[9]=month[11]=30;
for (int i=0;i>n;
for (int j=0;j
usaco 里的Friday the Thirteenth请牛人帮忙
judge有问题……
if (y%4==0&&y%100==0)
难道有 y%100==0但y%4!=0的吗?
int judge(int y)
{
if ((y%4==0&&y%100!=0)||(y%400==0))return 29;
return 28;
}
//粗心又犯了,已修改.