101 Raspunsuri multiple
Se consideră algoritmul one(nr) și algoritmul two(v, n), unde n este un număr natural nenul () și v un vector cu n numere naturale pozitive.
Algoritm 1
Algorithm two(v, n)
cnt ← 0; p ← 1
For i ← 1, n − 1 execute
For j ← n, i + 1, −1 execute
p ← p + 1
If (one(v[i]) MOD 2 = one(v[j]) MOD 2) AND (one(v[i]) MOD 2) then
cnt ← cnt + 1
EndIf
EndFor
EndFor
Return p − cnt − 1
EndAlgorithmAlgoritm 2
Algorithm one(nr)
c ← 0
For d ← 1, d * d ≤ nr execute
If nr MOD d = 0 then
c ← c + 1
If d * d < nr then c ← c + 1 EndIf
EndIf
EndFor
Return c
EndAlgorithmCare dintre următoarele afirmații sunt false?
35 / 60