-
Notifications
You must be signed in to change notification settings - Fork 437
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #722 from Otman404/master
Beginners Problem 2.0 [SOLVED]
- Loading branch information
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import java.util.*; | ||
|
||
class Main{ | ||
|
||
public static void main(String[] args) { | ||
Scanner in = new Scanner(System.in); | ||
int test; | ||
int nbrOfElm; | ||
int frequency; | ||
test = in.nextInt(); | ||
int [] output = new int[test]; | ||
for (int i = 0;i<test ;i++ ) { | ||
nbrOfElm = in.nextInt(); | ||
int [] elements = new int[nbrOfElm]; | ||
frequency = 0; | ||
for (int j = 0;j<nbrOfElm ;j++ ) { | ||
elements[j] = in.nextInt(); | ||
if (elements[j] % 2 == 0) { | ||
frequency++; | ||
} | ||
} | ||
output[i] = frequency; | ||
} | ||
System.out.println(); | ||
for(int i : output) | ||
System.out.println(i); | ||
} | ||
} |