帮忙解释下下面程序的意思吧,谢谢主要是x % 4 == 0 && x % 100 = 0 || x % 400 == 0的意思.#include void main( ){ int s,x1,y1,z1,x2,y2,z2; printf("Enter 6 integers:");scanf("%d%d%d%d%d%d",&x1,&y1,&z1,&x2,&y2,&z2);s = f(x2,y2,z2) - f(x1
来源:学生作业帮助网 编辑:六六作业网 时间:2024/11/13 03:56:49
帮忙解释下下面程序的意思吧,谢谢主要是x % 4 == 0 && x % 100 = 0 || x % 400 == 0的意思.#include void main( ){ int s,x1,y1,z1,x2,y2,z2; printf("Enter 6 integers:");scanf("%d%d%d%d%d%d",&x1,&y1,&z1,&x2,&y2,&z2);s = f(x2,y2,z2) - f(x1
帮忙解释下下面程序的意思吧,谢谢主要是x % 4 == 0 && x % 100 = 0 || x % 400 == 0的意思.
#include
void main( )
{ int s,x1,y1,z1,x2,y2,z2;
printf("Enter 6 integers:");
scanf("%d%d%d%d%d%d",&x1,&y1,&z1,&x2,&y2,&z2);
s = f(x2,y2,z2) - f(x1,y1,z1);
printf("%d\n",s);
}
f(int x,int y,int z)
{ int k,n;
int tab[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}
};
n = (x % 4 == 0 && x % 100 = 0 || x % 400 == 0);
for(k = 1; k < y; k++)
z = z + tab[n][k];
return z;
}
添加一个问题,麻烦啦
void main ( )
{ int a = -1,b = 1;
void f1(int x,int y),f2(int *x,int *y);
void f3(int *x,int *y),f4(int x,int y);
f1(a,b);
printf("(%d,%d)\n",a,b);
a = -1,b = 1;
f2(&a,&b);
printf("(%d,%d)\n",a,b);
a = -1,b = 1;
f3(&a,&b);
printf("(%d,%d)\n",a,b);
a = -1,b = 1;
f4(a,b);
printf("(%d,%d)\n",a,b);
}
void f1(int x,int y)
{ int t;
t = x; x = y; y = t;
}
void f2(int *x,int *y)
{ int t;
t = *x; *x = *y; *y = t;
}
void f3(int *x,int *y)
{ int *t;
t = x; x = y; y = t;
}
void f4(int x,int y)
{ int *t = malloc(sizeof(t));
*t = x; x = y; y = *t;
}
帮忙解释下下面程序的意思吧,谢谢主要是x % 4 == 0 && x % 100 = 0 || x % 400 == 0的意思.#include void main( ){ int s,x1,y1,z1,x2,y2,z2; printf("Enter 6 integers:");scanf("%d%d%d%d%d%d",&x1,&y1,&z1,&x2,&y2,&z2);s = f(x2,y2,z2) - f(x1
(x % 4 == 0 && x % 100 != 0 || x % 400 == 0)意思是能同时被
4,100,400整除 “%”是取余数的意思