fork(1) download
  1. import java.util.Arrays;
  2.  
  3. public class Main
  4. {
  5. private static void Pivo(double Matriz[], double Resultado){
  6. if (Matriz[0]==0){}
  7. else {
  8. double temp=Matriz[0];
  9. Resultado/=temp;
  10. for(int i=0;i<Matriz.length;i++){
  11. Matriz[i]/=temp;
  12. }
  13. }
  14. }
  15.  
  16. public static void main(String[] args){
  17. double Coeffs[][]={{4, 2, 20},{2, 3, 5},{5,7,9}};
  18. double Result[]={4,3,2};
  19.  
  20. System.out.println("Antes");
  21. System.out.println(Arrays.toString(Result));
  22.  
  23. Pivo(Coeffs[0], Result[0]);
  24.  
  25. System.out.println("Depois");
  26. System.out.println(Arrays.toString(Result));
  27. }
  28. }
Success #stdin #stdout 0.04s 2184192KB
stdin
Standard input is empty
stdout
Antes
[4.0, 3.0, 2.0]
Depois
[4.0, 3.0, 2.0]