Hàm cắt chuỗi họ tên thành chuỗi họ lót và chuỗi tên

void cathoten(char *s)
{
char *t;
int i;
for(i=strlen(s)-1;i>=0;i--)
if(s[i]==' '&&s[i+1]!=' ')
break;
t=s+i+1;
s[i]='\0';
cout<<"ho lot: ";
puts(s);
cout<<"ho ten: ";
puts(t);

}

Share this

Related Posts

Previous
Next Post »