-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path1066.java
96 lines (84 loc) · 1.33 KB
/
1066.java
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
import java.io.IOException;
import java.util.Locale;
import java.util.Scanner;
/*
*
*/
public class Main {
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(System.in);
Locale.setDefault(Locale.US);
int a,b,c,d,e,f;
int contador=0,contador_i=0,contador_p=0,contador_n=0;
a=sc.nextInt();
if(a%2==0) {
contador++;
}
if(a%2!=0) {
contador_i++;
}
if(a>0) {
contador_p++;
}
if(a<0) {
contador_n++;
}
b=sc.nextInt();
if(b%2==0) {
contador++;
}
if(b%2!=0) {
contador_i++;
}
if(b>0) {
contador_p++;
}
if(b<0) {
contador_n++;
}
c=sc.nextInt();
if(c%2==0) {
contador++;
}
if(c%2!=0) {
contador_i++;
}
if(c>0) {
contador_p++;
}
if(c<0) {
contador_n++;
}
d=sc.nextInt();
if(d%2==0) {
contador++;
}
if(d%2!=0) {
contador_i++;
}
if(d>0) {
contador_p++;
}
if(d<0) {
contador_n++;
}
e=sc.nextInt();
if(e%2==0) {
contador++;
}
if(e%2!=0) {
contador_i++;
}
if(e>0) {
contador_p++;
}
if(e<0) {
contador_n++;
}
System.out.println(contador+" valor(es) par(es)");
System.out.println(contador_i+" valor(es) impar(es)");
System.out.println(contador_p+" valor(es) positivo(s)");
System.out.println(contador_n+" valor(es) negativo(s)");
sc.close();
}
}