Vajad kellegagi rääkida?
Küsi julgelt abi LasteAbi
Logi sisse
Sulge

"istrue" - 1 õppematerjal

PPK outdated
24
doc

PPK(outdated)

System.out.print(array[i] + " "); 8. Array of ints, return true if the array contains a 2 next to a 2 somewhere. boolean found = false; for (int i = 0; i < nums.length; i++) { if (nums[i] == 2 && i > 0 && nums[i-1] == 2) { found = true;} if (nums[i] == 2 && i < nums.length-1 && nums[i+1] == 2) { found = true;}} return found; 9. Which number in array appears more. int count1 = 0; int count4 = 0; boolean isTrue = false; for (int i = 0; i < nums.length; i++) { if (nums[i] == 1) count1++; if (nums[i] == 4) count4++;} if (count1 > count4) isTrue = true; return isTrue; Strings 1. Two strings given, calculate number of words that start with same letter in both strings. int count = 0; for (int i = 0; i < a.length; i++) {

Informaatika → Java programmeerimine
35 allalaadimist


Sellel veebilehel kasutatakse küpsiseid. Kasutamist jätkates nõustute küpsiste ja veebilehe üldtingimustega Nõustun