#include<stdio.h>
#include<stdlib.h>
int main(int argc, char* argv[])
{
int N = 0, i = 0, sum = 0, count = 0;
double average = 0;
scanf_s("%d", &N);
if (N) {//判断是否输入正确
int* score = (int*)malloc(N * sizeof(int));
int* p = score;
for (i = 0;i < N;i++, p++) {
scanf_s("%d", p);
sum += *p;
if (*p >= 60) {
count++;
}
}
average = (float)sum / N;
printf("average = %.1f\n", average);
printf("count = %d", count);
free(score);
}
return 0;
}
结果显示正常但是看不懂PTA上的报错信息:
错误提示: