forked from pikachu-17/java-projects
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsumcontest.java
More file actions
32 lines (30 loc) · 973 Bytes
/
sumcontest.java
File metadata and controls
32 lines (30 loc) · 973 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import java.util.Scanner;
import java.io.*;
import java.util.Scanner;
public class sumcontest {
public static void main(String[] args) {
/* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */
Scanner scan = new Scanner(System.in);
int t=0;
int n = scan.nextInt();
do{
int even=0;
int odd =0;
for(int i =1;i<=n;i++){
if(n%2==0){
even++;
}
else{
odd++;
}
}
if(odd > even){
System.out.println("YES");
}
else if(even >= odd){
System.out.println("NO");
}
t++;
}while(t<n);
}
}