if (answer == 'Y') {
int a, u, l;
printf("How many numbers do you need?\n");
scanf("%d", a);
程序在此行后崩溃。我应该用什么来代替“%d”?格式'%d'需要'int *'类型的参数,但参数的类型为'int'
printf("Specify the lower bound of the range:");
scanf("%d", l);
printf("Specify the upper bound of the range:");
scanf("%d", u);
for(c = 1;c <= a ;c++) {
n = rand() %(u - l) + 1;
printf("%d\n", n);
}
}
上使用'scanf的任何C教程()'应该解释清楚。 – Barmar