fork download
  1. public string metodoRAro () {
  2. int [] lista={8,9,3};
  3. int n = lista.lenght;
  4. String[]simbolo = new String[n];
  5. int i,j,aux,izq,der,m;
  6. for (i=1;i<n;i++) {
  7. aux=lista[i]; izq=0; der=i-1;
  8. while(izq<=der){
  9. m=((izq+der)/2);
  10. if (aux<lista[m]){
  11. der=m-1;
  12. simbolo[i-1] = "-";
  13. }else{
  14. izq=m+1;
  15. simbolo[i-1] = "+"
  16. }
  17. }
  18. j=i-1;
  19. while(j>=izq){
  20. lista[j+1]=lista[j];
  21. j=j-1;
  22. }
  23. lista[izq]=aux;
  24. }
  25. simbolo [i-1]= "$";
  26. Sring salida = "";
  27. for (i=0;i<n;i++){
  28. salida += lista[i] + simbolo[i];
  29. }
  30. return salida
  31. }
  32.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:1:1: error: expected unqualified-id before ‘public’
 public string metodoRAro () {
 ^~~~~~
stdout
Standard output is empty