#include <iostream>
#include <stdlib.h>
using namespace std;
int h,anio[10],anio_act,prom,acum,a,b;
int main()
{
cout<<" *El anio de 10 personas*\n"<<endl;
cout<<"Ingresa el anio actual"<<endl;
cin>>anio_act;
for
(h=0; h<=9; h++)
{
cout<<"\ningresa el anio de nacimiento"<<endl;
cin>>anio[h];
}
for(h=0;h<=9;h++)
{
acum=acum+anio_act-anio[h];
}
prom=acum/10;
for(h=0;h<=9;h++)
{
if (anio_act-anio[h]>=18)
a++;
else
b++;
}
cout << a << " Personas mayores de edad" << endl;
cout << b << " Personas menores de edad " << endl;
for (h=0;h<=9;h++)
{
if (anio_act-anio[h]>18)
cout << "LA PERSONA " << h+1 << " ES MAYOR DE EDAD" << endl;
else
cout << "LA PERSONA " << h+1 << " ES MENOR DE EDAD" << endl;
}
system("pause");
return 0;
}

No hay comentarios:
Publicar un comentario