int input,n,i;
scanf("%d%d",&input,&n);
double a,b;
double complex arr[n];
for (i = 0; i < n; ++i)
{
scanf("%lf%lf",&a,&b);
creal(arr[i])=a;
cimag(arr[i])=b;
}
错误:左值作为赋值enter code here
的左操作数需要左值
creal(ARR [I])= A;
为什么我不能输入复数
答案 0 :(得分:0)
根据6.2.5p13,您可以(未经测试!)
double complex a[42];
double tmp[2];
tmp[0] = 3.14159;
tmp[1] = -2.71828;
memmove(a + 3, tmp, sizeof tmp); // a[3] = 3.14159 - 2.71828i