0_0_35882231_22055.cpp: In function 'int main()': 0_0_35882231_22055.cpp:83:71: error: 'i' was not declared in this scope for(int i=1;i<=m;i++) scanf("%d%d%d",&x[i],&y[i],&w[i]);add(x[i],y[i],w[i]); ^