Advertisement
Guest User

Untitled

a guest
Feb 1st, 2015
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. package skoczek;
  2. import java.util.Scanner;
  3.  
  4. public class Skoczek
  5. {
  6. public static double[][] skoki(double tab[][], int K, int P)
  7. {
  8. double styl = 0, dlugosc = 0, max=0, min=0, notaMin = 0, notaMax = 0;
  9.  
  10. for(int i=0; i<tab.length; i++)
  11. {
  12. for(int q=3; q<7; q++)
  13. {
  14. if (tab[i][q]>notaMax)
  15. notaMax = tab[i][q];
  16. else if (tab[i][q]<notaMin)
  17. notaMin = tab[i][q];
  18. }
  19. styl = tab[i][3]+tab[i][4]+tab[i][5]+tab[i][6]+tab[i][7]-notaMax-notaMin;
  20. dlugosc = 60 - tab[i][2];
  21. tab[i][8]= styl + dlugosc;
  22. }
  23. return tab;
  24. }
  25.  
  26.  
  27. public static void main(String[] args)
  28. {
  29. Scanner in = new Scanner (System.in);
  30. System.out.println("Glupi program ze skokami");
  31. int w = 0, k = 60, p = 0;
  32. double[][] tablica = {{11, 2, 15, 13, 20, 25, 37, 0},
  33. {12, 4, 15, 11, 20, 25, 37, 0},
  34. {13, -3, 15, 10, 20, 35, 37, 0},
  35. {14, -3, 45, 13, 20, 25, 37, 0},
  36. {15, 1, 35, 13, 10, 25, 37, 0}};
  37. skoki(tablica, k, p);
  38. }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement