-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1066.cpp
More file actions
35 lines (31 loc) · 743 Bytes
/
1066.cpp
File metadata and controls
35 lines (31 loc) · 743 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
33
34
35
#include <iostream>
using namespace std;
int main ()
{
int valor, pares=0, impares=0, positivos=0, negativos=0;
for (int i=0; i<5; i++)
{
cin >> valor;
if(valor % 2 == 0)
{
pares = pares + 1;
}
if(valor % 2 != 0)
{
impares = impares + 1;
}
if(valor > 0)
{
positivos = positivos + 1;
}
if(valor < 0)
{
negativos = negativos + 1;
}
}
cout << pares << " valor(es) par(es)" << endl;
cout << impares << " valor(es) impar(es)" << endl;
cout << positivos << " valor(es) positivo(s)" << endl;
cout << negativos << " valor(es) negativo(s)" << endl;
return 0;
}