Answers
不是,是double a[]的赋值,不能用ascii检验的。我想赋数字,而且很大并非0--9.
------------------------------------------
试一下这样怎么样?
#include <stdio.h>
int main(void)
{
double a[10];
int i = 0 ;
for (int j = 0; j < 10; j++)
{
printf ( "\n请输入第 %d 个数字\n-> ", j+1);
while (scanf ( "%f ", &a[i++]) != 1)
{
printf ( "\n输入有错,请重新输入\n-> ");
while (getchar () != '\n ')
{
NULL;
}
}
}
}
Alvinwx
answered 11 years, 6 months ago