void union(int a, int b) { a = FindRoot(a); //without new variables b = FindRoot(b); if (a == b) return; if (rand() % 2) root[a] = b; else root[b] = a;}
Standard input is empty
prog.cpp:1:11: error: expected identifier before '(' token void union(int a, int b) { ^ prog.cpp:1:12: error: expected unqualified-id before 'int' void union(int a, int b) { ^ prog.cpp:1:12: error: expected ')' before 'int'
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!