Skip to content

Commit

Permalink
Merge pull request #722 from Otman404/master
Browse files Browse the repository at this point in the history
Beginners Problem 2.0 [SOLVED]
  • Loading branch information
TANIYA GUPTA authored Oct 29, 2018
2 parents fb8d869 + 3edca90 commit ddb9e9c
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions SOLUTIONS/Beginner_Problem.java
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);
}
}

0 comments on commit ddb9e9c

Please sign in to comment.