Error: begin was not declared in the scope
The error is in for loop
#include<bits/stdc++.h>
using namespace std;
vector v[1001];
void dfs(int i,vector &v) {
for(int c: v[i])
cout<<c;
}
int main() {
int n,e,a,b;
cin>>n>>e;
vector<bool> vis(n+1,0);
vector<int> v[n+1];
while(e--) {
cin>>a>>b;
v[a].push_back(b);
v[b].push_back(a);
}
dfs(1,v);
}