今天在代码里写了个goto,然后就报错了,有人帮忙看看吗
#include<bits/stdc++.h>
using namespace std;
struct _{
int t,price;
};
struct cmp{
bool operator()(_ a,_ b){
return a.t>b.t;
}
};
int n,m,price[100005],t[100005],ans;
priority_queue<_,vector<_>,cmp> ticket;
int main(){
scanf("%d",&n);
for(int i=1;i<=n;i++){
int v;
scanf("%d%d%d",v,price[i],t[i]);
if(v==0){
ans+=price[i];
ticket.emplace(t[i],price[i]);
}
else if(v==1){
lable:
goto lable;
}
}
return 0;
}
D:/杞欢/灏忕唺鐚獵++/RedPanda-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/x86_64-w64-mingw32/bits/c++allocator.h 33 0 In file included from D:/杞欢/灏忕唺鐚獵++/RedPanda-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/x86_64-w64-mingw32/bits/c++allocator.h
D:/杞欢/灏忕唺鐚獵++/RedPanda-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/new_allocator.h 0 -1 In instantiation of 'void std::__new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = _; _Args = {int&, int&}; _Tp = _]':
D:/杞欢/灏忕唺鐚獵++/RedPanda-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/alloc_traits.h 537 17 required from 'static void std::allocator_traits<std::allocator<_CharT> >::construct(allocator_type&, _Up*, _Args&& ...) [with _Up = _; _Args = {int&, int&}; _Tp = _; allocator_type = std::allocator<_>]'
D:/杞欢/灏忕唺鐚獵++/RedPanda-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/vector.tcc 117 30 required from 'void std::vector<_Tp, _Alloc>::emplace_back(_Args&& ...) [with _Args = {int&, int&}; _Tp = _; _Alloc = std::allocator<_>]'
D:/杞欢/灏忕唺鐚獵++/RedPanda-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/stl_queue.h 756 18 required from 'void std::priority_queue<_Tp, _Sequence, _Compare>::emplace(_Args&& ...) [with _Args = {int&, int&}; Tp = ; Sequence = std::vector<_>; Compare = cmp]'
D:/用户文件/桌面/C++/临时/未命名1.cpp 20 18 required from here
D:/杞欢/灏忕唺鐚獵++/RedPanda-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/new_allocator.h 187 11 [错误] new initializer expression list treated as compound expression [-fpermissive]
D:/杞欢/灏忕唺鐚獵++/RedPanda-Cpp/MinGW64/lib/gcc/x86_64-w64-mingw32/13.1.0/include/c++/bits/new_allocator.h 187 11 [错误] no matching function for call to '::(int&)'
D:/用户文件/桌面/C++/临时/未命名1.cpp 3 8 [说明] candidate: '::()'
D:/用户文件/桌面/C++/临时/未命名1.cpp 3 8 [说明] candidate expects 0 arguments, 1 provided
D:/用户文件/桌面/C++/临时/未命名1.cpp 3 8 [说明] candidate: 'constexpr ::(const &)'
D:/用户文件/桌面/C++/临时/未命名1.cpp 3 8 [说明] no known conversion for argument 1 from 'int' to 'const &'
D:/用户文件/桌面/C++/临时/未命名1.cpp 3 8 [说明] candidate: 'constexpr ::(&&)'
D:/用户文件/桌面/C++/临时/未命名1.cpp 3 8 [说明] no known conversion for argument 1 from 'int' to '&&'
(中间的两个数字是行和列)