#pragma warning(disable : 4996) //此处VS需要用到,其他编译环境可以把此行屏蔽掉
#include <iostream>
#include <string.h>
using namespace std;
class STRING
{
private:
char str1[60] ;
char str2[40] ;
char str3[100];
public:
STRING(char* s1, char* s2)
{
strcpy(str1,s1);
strcpy(str2, s2);
strcpy(str3, "");
}
void process()
{
int m = 0, n = 0;
for (int i = 0; i < 100; i++) {
if (i % 2 == 0) {
str3[i] = str1[m++];
}
else {
str3[i] = str2[n++];
}
}
}
void print()
{
cout << str3 << endl;
}
};
int main()
{
char a[] = "abcde";
char b[] = "ABCDEFG";
STRING test(a,b);
test.process();
test.print();
}