int main()
{
char *str = "青年杂志(上半年)";
char str1[] = "一份耕耘一份收获";
int nLen = strlen(str);
char Temp[4];
for (int i=0; i<nLen; i=i+2)
{
memcpy(Temp, str+i, 2);
Temp[2]='\0';
cout << Temp;
}
cout << endl;
for (int j=0; j<nLen; j=j+2)
{
memcpy(Temp, str1+j, 2);
Temp[2]='\0';
cout << Temp;
}
cout << endl;
cout << str << "," << str1 << endl;
return 0;
}
{
char *str = "青年杂志(上半年)";
char str1[] = "一份耕耘一份收获";
int nLen = strlen(str);
char Temp[4];
for (int i=0; i<nLen; i=i+2)
{
memcpy(Temp, str+i, 2);
Temp[2]='\0';
cout << Temp;
}
cout << endl;
for (int j=0; j<nLen; j=j+2)
{
memcpy(Temp, str1+j, 2);
Temp[2]='\0';
cout << Temp;
}
cout << endl;
cout << str << "," << str1 << endl;
return 0;
}