Breaking News
Loading...
Monday, July 15, 2013

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

7/15/2013 09:09:00 AM
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);

}

0 comments:

Post a Comment

 
Toggle Footer