#include <iostream>
#include <math.h>
using namespace std;
int main() {
int anio,mes,dia,m,tot,suma=0,aux=1;
cout<<"Ingrese el anio de su nacimiento\n";
cin>>anio;
cout<<"\nIngrese el mes de su nacimiento(1-12)\n";
cin>>mes;
cout<<"\nIngrese el dia de su nacimeinto\n";
cin>>dia;
tot=anio+mes+dia;
cout<<"\nEl total es "<<tot;
while(tot!=0){
m=tot%10;
tot=floor(tot/10);
suma+=m;
}
tot=suma;
if(tot>=10){
suma=0;
m=0;
while(tot!=0){
m=tot%10;
tot=floor(tot/10);
suma+=m;
}
}
cout<<"\nEl numero que le corresponde es "<<suma;
return 0;
}
No hay comentarios.:
Publicar un comentario