Guest User

Untitled

a guest
Dec 11th, 2019
80
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. int[] valorsSuperiors(int[] llista, double valor) {
  2. int comptador = 0;
  3. for (int i = 0; i < llista.length; i++) {
  4. if (llista[i] > valor) {
  5. comptador++;
  6. }
  7. }
  8. int[] vectorSuperior = new int[comptador];
  9. //Omplo el vector
  10. for (int i = 0; i < vectorSuperior.length; i++) {
  11. for (int j = 0; j < llista.length; j++) {
  12. if (llista[j] > valor) {
  13. vectorSuperior[i] = llista[j];
  14. }
  15. }
  16. }
  17. return vectorSuperior;
  18. }
RAW Paste Data