#include<iostream>
#include<set>
#include<unordered_map>
using namespace std;
typedef long Node;
typedef unordered_map<Node, set<Node> > Dothi;
Dothi g;
while (n--)
{
Node u, i;
int choose;
cin >> choose;
if (choose == 1)
{
cin >> u >> i;
cout << (Lienke(u, i) ? "TRUE" : "FALSE");
}
checkCase2 = false;
if (choose == 2)
{
cin >> u;
for ( auto n = g[u].begin(); n!=g[u].end();++n)
{
cout << n <<" "; //Error here, cant cout n
checkCase2 = true;
}
ich nicht unter der Leitung cout kann: „für (auto n = g [u] .begin(); n = g [u] .end (!); ++ n) ".kein Operator "<<" Spiele
Es heißt: "kein Operator" < < "passt diese Operanden".
Ich darf C++ 2003
n ist ein Iterator. Versuchen Sie es mit * n: cout << * n << ""; –
Vielen Dank, ich habe versucht und es hat funktioniert, aber das System sagte: "ISO C++ verbietet die Deklaration von 'n' ohne Typ". –
@MartinHoang C++ 03 hat kein 'auto'. – LogicStuff