/ Vijos /

记录详情

Compile Error

/in/foo.cc: In function 'int main()':
/in/foo.cc:7:9: error: 'string' was not declared in this scope; did you mean 'std::string'?
    7 |         string a,stu;
      |         ^~~~~~
      |         std::string
In file included from /usr/include/c++/12/iosfwd:39,
                 from /usr/include/c++/12/ios:38,
                 from /usr/include/c++/12/ostream:38,
                 from /usr/include/c++/12/iostream:39,
                 from /in/foo.cc:1:
/usr/include/c++/12/bits/stringfwd.h:77:33: note: 'std::string' declared here
   77 |   typedef basic_string<char>    string;
      |                                 ^~~~~~
/in/foo.cc:8:9: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
    8 |         cin>>n;
      |         ^~~
      |         std::cin
/usr/include/c++/12/iostream:60:18: note: 'std::cin' declared here
   60 |   extern istream cin;           /// Linked to standard input
      |                  ^~~
/in/foo.cc:13:22: error: 'a' was not declared in this scope
   13 |                 cin>>a>>b>>c>>d>>e>>f;
      |                      ^
/in/foo.cc:24:25: error: 'stu' was not declared in this scope; did you mean 'std'?
   24 |                         stu=a;
      |                         ^~~
      |                         std
/in/foo.cc:27:9: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
   27 |         cout<<stu<<endl<<max<<endl<<sum;
      |         ^~~~
      |         std::cout
/usr/include/c++/12/iostream:61:18: note: 'std::cout' declared here
   61 |   extern ostream cout;          /// Linked to standard output
      |                  ^~~~
/in/foo.cc:27:15: error: 'stu' was not declared in this scope; did you mean 'std'?
   27 |         cout<<stu<<endl<<max<<endl<<sum;
      |               ^~~
      |               std
/in/foo.cc:27:20: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
   27 |         cout<<stu<<endl<<max<<endl<<sum;
      |                    ^~~~
      |                    std::endl
/usr/include/c++/12/ostream:688:5: note: 'std::endl' declared here
  688 |     endl(basic_ostream<_CharT, _Traits>& __os)
      |     ^~~~
/in/foo.cc:5:15: warning: unused variable 'j' [-Wunused-variable]
    5 |         int i,j,n,sum,max,b,c,f,money;
      |               ^

信息

递交者
类型
自测
题目
P1001 谁拿了最多奖学金
语言
C++
递交时间
1 个月前
评测时间
1 个月前
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes