Răspuns:
using namespace std;
#include <iostream>
#include <stdlib.h>
#include <math.h>
int main()
{
char CNP[13];
cout<<"CNP ";cin>>CNP;
if (CNP[0]=='1') {
cout<<"Barbat \n"<<"Data nasterii 19"<<CNP[1];
cout<<CNP[2]<<" ";
cout<<CNP[3]<<CNP[4]<<" ";
cout<<CNP[5]<<CNP[6];
}
if (CNP[0]=='2') {
cout<<"Femeie \n"<<"Data nasterii 19"<<CNP[1];
cout<<CNP[2]<<" ";
cout<<CNP[3]<<CNP[4]<<" ";
cout<<CNP[5]<<CNP[6];
}
if (CNP[0]=='5') {
cout<<"Barbat \n"<<"Data nasterii 20"<<CNP[1];
cout<<CNP[2]<<" ";
cout<<CNP[3]<<CNP[4]<<" ";
cout<<CNP[5]<<CNP[6];
}
if (CNP[0]=='6') {
cout<<"Femeie \n"<<"Data nasterii 20"<<CNP[1];
cout<<CNP[2]<<" ";
cout<<CNP[3]<<CNP[4]<<" ";
cout<<CNP[5]<<CNP[6];
}
}