Untitled1.cpp
#include <cstdlib> #include <iostream> using namespace std; int main(int argc, char *argv[]) { int N1,N2,N3,N4,N5,N6,N7,N8,N9,N10, PAR,IMPAR; PAR=0; IMPAR=0; cout<<" INGRESE 10 NUMEROS ENTEROS ";cout<<endl; cout<<endl; cout<<" N1 "; cin>>N1; cout<<endl; cout<<" N2 "; cin>>N2; cout<<endl; cout<<" N3 "; cin>>N3; cout<<endl; cout<<" N4 "; cin>>N4; cout<<endl; cout<<" N5 "; cin>>N5; cout<<endl; cout<<" N6 "; cin>>N6; cout<<endl; cout<<" N7 "; cin>>N7; cout<<endl; cout<<" N8 "; cin>>N8; cout<<endl; cout<<" N9 "; cin>>N9; cout<<endl; cout<<" N10 "; cin>>N10; cout<<endl; if(N1%2==0) PAR=PAR+1; else IMPAR=IMPAR+1; if(N2%2==0) PAR=PAR+1; else IMPAR=IMPAR+1; if(N3%2==0) PAR=PAR+1; else IMPAR=IMPAR+1; if(N4%2==0) PAR=PAR+1; else IMPAR=IMPAR+1; if(N5%2==0) PAR=PAR+1; else IMPAR=IMPAR+1; if(N6%2==0) PAR=PAR+1; else IMPAR=IMPAR+1; if(N7%2==0) PAR=PAR+1; else IMPAR=IMPAR+1; if(N8%2==0) PAR=PAR+1; else IMPAR=IMPAR+1; if(N9%2==0) PAR=PAR+1; else IMPAR=IMPAR+1; if(N10%2==0) PAR=PAR+1; else IMPAR=IMPAR+1; cout<<" CANTIDAD DE NUMEROS PARES " <<PAR; cout<<endl; cout<<endl; cout<<" CANTIDAD DE NUMEROS IMPARES " <<IMPAR; cout<<endl; system("PAUSE"); return EXIT_SUCCESS; }
|