#include <stdio.h>
#include <stdlib.h>
int main() {
int x,z,c;
x = srand() % 64 + 16;
z = srand() % 64 + 16;
c = srand() % 64 + 16;
if (x %= z %= c)
printf("no");
else
printf("yes");
system("pause");
return 0;
}
#include <stdio.h>
#include <stdlib.h>
int main() {
int x,z,c;
x = srand() % 64 + 16;
z = srand() % 64 + 16;
c = srand() % 64 + 16;
if (x %= z %= c)
printf("no");
else
printf("yes");
system("pause");
return 0;
}
随机数产生方法不正确,修改了一下,如下:
#include <stdio.h>
#include <stdlib.h>
#include <time.h> //为time()函数提供原型
int main() {
int x,z,c;
srand((unsigned int) time(0)); //用当前时间初始化随机数种子,用于后面rand函数产生相应随机数
x = rand() % 64 + 16;
z = rand() % 64 + 16;
c = rand() % 64 + 16;
if (x %= z %= c)
printf("no");
else
printf("yes");
system("pause");
return 0;
}