记录详情

Compile Error

/in/foo.c: In function 'main':
/in/foo.c:7:2: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
  if(n=1) s=1;
  ^~
/in/foo.c:8:2: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
  else if(n=2) s=2;
  ^~~~
/in/foo.c:9:13: warning: statement with no effect [-Wunused-value]
       else(n>=3){
           ~~^~~~
/in/foo.c:9:17: error: expected ';' before '{' token
       else(n>=3){
                 ^
/in/foo.c:5:28: warning: variable 's' set but not used [-Wunused-but-set-variable]
     int n,i,a1=1,a2=1,an=0,s;
                            ^
/in/foo.c:5:23: warning: unused variable 'an' [-Wunused-variable]
     int n,i,a1=1,a2=1,an=0,s;
                       ^~
/in/foo.c:5:18: warning: unused variable 'a2' [-Wunused-variable]
     int n,i,a1=1,a2=1,an=0,s;
                  ^~
/in/foo.c:5:13: warning: unused variable 'a1' [-Wunused-variable]
     int n,i,a1=1,a2=1,an=0,s;
             ^~
/in/foo.c:5:11: warning: unused variable 'i' [-Wunused-variable]
     int n,i,a1=1,a2=1,an=0,s;
           ^

信息

递交者
类型
自测
题目
A2-3 循环结构入门:斐波拉契数列的和
语言
C
递交时间
2019-03-31 20:46:14
评测时间
2019-03-31 20:46:14
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes