#include#include 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 = %.1fn", average); printf("count = %d", count); free(score); } return 0; }
结果显示正常但是看不懂PTA上的报错信息:
错误提示:
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)