Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
4357 柯宇希 13分数求和 C++ Compile Error 0 MS 0 KB 302 2024-08-16 16:03:42

Tests(0/0):


Code:

# include<iostream> # include<climits> using namespace std; int main(){ double ans=0; cin>>n; ans=fz*1.0/fm; for(int i=2;i<=n;i++){ t=fz; fz=fz+fm; fm=t; ans+=fz*1.0/fm; } cout<<fixed<<setprecision(4)<<ans<<endl; return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:7:10: error: 'n' was not declared in this scope
     cin>>n;
          ^
Main.cc:8:9: error: 'fz' was not declared in this scope
     ans=fz*1.0/fm;
         ^
Main.cc:8:16: error: 'fm' was not declared in this scope
     ans=fz*1.0/fm;
                ^
Main.cc:10:9: error: 't' was not declared in this scope
         t=fz;
         ^
Main.cc:15:32: error: 'setprecision' was not declared in this scope
     cout<fixed<<setprecision(4)<<ans<<endl;
                                ^