Compile Error

/in/foo.cc:9:9: error: expected unqualified-id before '{' token
    9 |         {
      |         ^
/in/foo.cc: In function 'int main()':
/in/foo.cc:18:27: error: expected ';' before '<' token
   18 |         for(int i=0,x,y,zi<n;i++)
      |                           ^
      |                           ;
/in/foo.cc:18:27: error: expected primary-expression before '<' token
/in/foo.cc:20:28: error: 'z' was not declared in this scope
   20 |                 cin>>x>>y>>z;
      |                            ^
/in/foo.cc:21:28: error: no matching function for call to 'std::vector<st>::push_back(<brace-enclosed initializer list>)'
   21 |                 s.push_back({x,y,z});
      |                 ~~~~~~~~~~~^~~~~~~~~
In file included from /usr/include/c++/12/vector:64,
                 from /usr/include/c++/12/queue:61,
                 from /usr/include/x86_64-linux-gnu/c++/12/bits/stdc++.h:86,
                 from /in/foo.cc:1:
/usr/include/c++/12/bits/stl_vector.h:1276:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = st; _Alloc = std::allocator<st>; value_type = st]'
 1276 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/12/bits/stl_vector.h:1276:35: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const std::vector<st>::value_type&' {aka 'const st&'}
 1276 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/12/bits/stl_vector.h:1293:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = st; _Alloc = std::allocator<st>; value_type = st]'
 1293 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/12/bits/stl_vector.h:1293:30: note:   no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::vector<st>::value_type&&' {aka 'st&&'}
 1293 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~

信息

递交者
类型
递交
语言
C++
递交时间
2025-02-06 13:56:20
评测时间
2025-02-06 13:56:20
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes