Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
91344 罗迎甲 13分数求和 C++ Compile Error 0 MS 0 KB 215 2024-09-21 16:18:13

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int main() { int n; double s=0,a=2,b=1,t; cin>>n; for(int i=1;i<=n;i++){ s=s+a/b; t=a; a=a=b; b=t; } printf("%.4lf",s) return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:12:8: warning: operation on 'a' may be undefined [-Wsequence-point]
   a=a=b;
        ^
Main.cc:17:2: error: expected ';' before 'return'
  return 0; 
  ^