Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
62298 郭晓航 小猫吃鱼 C++ Compile Error 0 MS 0 KB 583 2023-12-22 20:17:07

Tests(0/0):


Code:

#include<iostream> using namespace; struct two { int a; int b; }t[100]; int main() { int n; cin>>n; for(int i=0;i<n;i++) { cin>>t[i].a>>t[i].b; } int l=1000; int fish=0,sum=0; for(int i=0;i<n;i++) { if(t[i].a<=l||fish==0) { sum+=t[i].a; l=t[i].a+t[i].b; fish++; continue; } if(l<t[i].a) { sum+=l; l+=t[i].b; fish++; } } cout<<sum; return 0; }


Run Info:

Main.cc:3:16: error: expected identifier before ';' token
 using namespace;
                ^
Main.cc: In function 'int main()':
Main.cc:14:5: error: 'cin' was not declared in this scope
     cin>>n;
     ^
Main.cc:14:5: note: suggested alternative:
In file included from Main.cc:1:0:
/usr/include/c++/5/iostream:60:18: note:   'std::cin'
   extern istream cin;  /// Linked to standard input
                  ^
Main.cc:37:5: error: 'cout' was not declared in this scope
     cout<