Why my code is giving the error:
error: class, interface, or enum expected
Follow the code:
import java.util.Scanner;
public class teste175 {
public static void main (String[] args) {
Scanner sc = new Scanner (System.in);
int a, i;
a = sc.nextInt();
int v[] = new int [a];
for (i=0; i<a; i++) {
v[i] = sc.nextInt();
}
funcao (v, a);
}
}
static int funcao (int v[], int a){
int temp, j, i;
for (j=0; j<a; j++){
for (i=1; i<a; i++){
if (v[i]<v[i-1] {
temp = v[i];
v[i] = v[i-1];
v[i-1] = temp;
}
}
}
return v;
}
}