文章
34
粉丝
109
获赞
7
访问
19.3k
#include <stdio.h>
#include <string.h>
int month[2][13] = {
{0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},
{0, 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},
};
int Isleap(int y)
{
if ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0)
{
return 1;
}
else
{
return 0;
}
}
int day(int y, int m, int d)
{
int days;
if (Isleap(y))
{
days = 0;
for (int i = 1; i < m; i++)
{
days += month[1][i];
}
days += d;
}
else
{
days = 0;
for (int i = 1; i < m; i++)
{
days += month[0][i];
}
days += d;
}
return days;
}
int main()
{
int x, y;
while (scanf("%d %d", &x, &y) != EOF)
{
if (x < y)
{
int temp = y;
y = x;
x = temp;
}
int year1 = x / 10...
登录后发布评论
暂无评论,来抢沙发