记录详情

Compile Error

foo.cc: In function 'int main()':
foo.cc:9:18: error: expected ')' before ';' token
  for(i=3;i<=n;i++;)f[i]=f[i-1]+f[i-2];
                  ^
foo.cc:9:2: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
  for(i=3;i<=n;i++;)f[i]=f[i-1]+f[i-2];
  ^~~
foo.cc:9:19: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
  for(i=3;i<=n;i++;)f[i]=f[i-1]+f[i-2];
                   ^
foo.cc:9:19: error: expected primary-expression before ')' token
foo.cc:7:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d",&n);
  ~~~~~^~~~~~~~~

信息

递交者
类型
递交
题目
2-4 攀登华山
语言
C++
递交时间
2021-02-06 14:08:13
评测时间
2021-02-06 14:08:13
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes