我想创建一个简单的程序,它会生成0到1之间的随机数。
double x2, x3, z0, z1;
int i = 0;
double x0 = 0.3453;
double x1 = 0.3894;
for (i = 0; i < 50; i++)
{
x2 = (x0 + x1)%1.0;
x3 = (x1 + x2)%1.0;
[...]
“x2 = ...”和“x3 = ...”行有问题 我收到一个错误:“类型'double'和'double'到二进制'operator%'的操作数无效