/ Vijos /

记录详情

Compile Error

foo.c: In function 'rec':
foo.c:12:15: error: 'b' undeclared (first use in this function)
   12 |  if (count == b && sushu(sum)) {
      |               ^
foo.c:12:15: note: each undeclared identifier is reported only once for each function it appears in
foo.c:13:3: error: 'ans' undeclared (first use in this function)
   13 |   ans++;
      |   ^~~
foo.c:15:23: error: 'n' undeclared (first use in this function)
   15 |  for (i = start; i <= n; i++) {
      |                       ^
foo.c:16:31: error: 'a' undeclared (first use in this function)
   16 |   rec(i + 1, count + 1, sum + a[i]);
      |                               ^
foo.c: In function 'main':
foo.c:22:9: error: conflicting types for 'a'
   22 |     int a[20];
      |         ^
foo.c:20:9: note: previous declaration of 'a' was here
   20 |     int a,b;
      |         ^
foo.c:23:18: warning: comparison between pointer and integer
   23 |     for(int i=0;i<a;i++){
      |                  ^
foo.c:27:15: error: 'ans' undeclared (first use in this function)
   27 |  printf("%d", ans);
      |               ^~~
foo.c:21:5: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
   21 |     scanf("%d%d",&a,&b);
      |     ^~~~~~~~~~~~~~~~~~~
foo.c:24:9: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
   24 |         scanf("%d",&a[i]);
      |         ^~~~~~~~~~~~~~~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1128 选数
语言
C
递交时间
2022-03-22 15:49:43
评测时间
2022-03-22 15:49:43
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes