foo.c:5:15: error: expected ';', ',' or ')' before '&' token
5 | void swap(int &x,int &y)
| ^
foo.c: In function 'main':
foo.c:25:3: warning: implicit declaration of function 'swap' [-Wimplicit-function-declaration]
25 | swap(a[i],a[a[i]-1]);
| ^~~~
foo.c:16:2: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
16 | scanf("%d",&n);
| ^~~~~~~~~~~~~~
foo.c:19:3: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
19 | scanf("%d" ,&a[i]);
| ^~~~~~~~~~~~~~~~~~
[Hydro](https://hydro.ac)提供评测服务