Last active
April 10, 2020 20:33
-
-
Save wrpinheiro/859a30d8c29778238f111708442bf521 to your computer and use it in GitHub Desktop.
algoritmos-corretude
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public int somaNumPares(int[] A) { | |
int i = 0; | |
int soma = 0; | |
int n = A.length; | |
while(i < n) { | |
if(A[i] % 2 == 0) | |
soma = soma + A[i]; | |
i++; | |
} | |
return soma; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment