Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ProgramaMisterios {
- public static final int[] array = {1, 6, 4, 8, 3, 7, 3, 6, 9, 4, 2, 9, 6};
- public static void main(String[] args) {
- int i = 1;
- int resultat = 0;
- while (array[i] != 9) {
- if (array[i - 1] < array[i]) {
- resultat++;
- }
- i++;
- }
- System.out.println("El resultat és " + resultat + ".");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement