记录详情

Accepted

foo.c:2:1: warning: data definition has no type or storage class
    2 | PrimeCount(int a[], int n);
      | ^~~~~~~~~~
foo.c:2:1: warning: type defaults to 'int' in declaration of 'PrimeCount' [-Wimplicit-int]
foo.c:16:1: warning: return type defaults to 'int' [-Wimplicit-int]
   16 | PrimeCount(int a[], int n) {
      | ^~~~~~~~~~
foo.c: In function 'PrimeCount':
foo.c:21:20: warning: implicit declaration of function 'sqrt' [-Wimplicit-function-declaration]
   21 |   for (j = 2; j <= sqrt(a[i]); j++) {
      |                    ^~~~
foo.c:21:20: warning: incompatible implicit declaration of built-in function 'sqrt'
foo.c:2:1: note: include '<math.h>' or provide a declaration of 'sqrt'
    1 | #include <stdio.h>
  +++ |+#include <math.h>
    2 | PrimeCount(int a[], int n);
foo.c:25:11: warning: incompatible implicit declaration of built-in function 'sqrt'
   25 |   if (j > sqrt(a[i]))
      |           ^~~~
foo.c:25:11: note: include '<math.h>' or provide a declaration of 'sqrt'
foo.c: In function 'main':
foo.c:6:2: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
    6 |  scanf("%d %d", &n1, &n2);
      |  ^~~~~~~~~~~~~~~~~~~~~~~~
foo.c:8:3: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
    8 |   scanf("%d", & a[i]);
      |   ^~~~~~~~~~~~~~~~~~~
foo.c:10:3: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
   10 |   scanf("%d", & b[i]);
      |   ^~~~~~~~~~~~~~~~~~~
foo.c: In function 'PrimeCount':
foo.c:29:1: warning: control reaches end of non-void function [-Wreturn-type]
   29 | }
      | ^
[Hydro](https://hydro.ac)提供评测服务
# 状态 耗时 内存占用
#1 Accepted 2ms 384.0 KiB
#2 Accepted 2ms 512.0 KiB
#3 Accepted 2ms 384.0 KiB
#4 Accepted 4ms 384.0 KiB
#5 Accepted 3ms 384.0 KiB

信息

递交者
类型
递交
比赛
南师大2021程序设计基础课程第四次测验 (2021-12-23)
语言
C
递交时间
2021-12-23 13:54:33
评测时间
2021-12-23 13:54:33
评测机
分数
100
总耗时
15ms
峰值内存
512.0 KiB