记录详情

Compile Error

foo.c: In function 'main':
foo.c:13:30: error: conflicting types for 'a'
   13 |  int s,i,j,k,n,a[100],b[100],a,b;
      |                              ^
foo.c:13:16: note: previous declaration of 'a' was here
   13 |  int s,i,j,k,n,a[100],b[100],a,b;
      |                ^
foo.c:13:32: error: conflicting types for 'b'
   13 |  int s,i,j,k,n,a[100],b[100],a,b;
      |                                ^
foo.c:13:23: note: previous declaration of 'b' was here
   13 |  int s,i,j,k,n,a[100],b[100],a,b;
      |                       ^
foo.c:17:19: error: subscripted value is neither array nor pointer nor vector
   17 |   scanf("%d %d",&b[i],&a[i]);
      |                   ^
foo.c:17:25: error: subscripted value is neither array nor pointer nor vector
   17 |   scanf("%d %d",&b[i],&a[i]);
      |                         ^
foo.c:19:14: error: subscripted value is neither array nor pointer nor vector
   19 |   sum2=sum2*a[i];
      |              ^
foo.c:22:6: error: subscripted value is neither array nor pointer nor vector
   22 |   k=b[i];
      |      ^
foo.c:24:9: error: subscripted value is neither array nor pointer nor vector
   24 |    k=k*a[j];
      |         ^
foo.c:25:8: error: subscripted value is neither array nor pointer nor vector
   25 |   k=k/a[i];
      |        ^
foo.c:15:2: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
   15 |  scanf("%d",&n);
      |  ^~~~~~~~~~~~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
比赛
2022春 C语言课程设计 作业1
语言
C
递交时间
2022-02-28 23:10:04
评测时间
2022-02-28 23:10:04
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes