#include<iostream>
using namespace std;
void connect(char *p1,char *p2)
{
for(;*p1!='\0';p1++);
for(;*p2!='\0';p2++)
{
if(*p2>='0'&&*p2<='9')
{
*p1=*p2;
p1++;
}
}
*p1='\0';
}
int main()
{
char str1[30],str2[20];
char *ps1=str1;
char *ps2=str2;
cout<<"请输入两个字符串"<<endl;
cin.getline(ps1,30);
cin.getline(ps2,20);
connect(ps1,ps2);
cout<<"连接后"<<endl;
cout<<ps1<<endl;
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: