#include <iostream>
using namespace std;
#define MAXSIZE 100#define TRUE 1
#define FALSE 0
#define OK 1
#define ERROR 0
#define INFEASIBLE -1
#define OVERFLOW -2typedef int Status;typedef struct {int *elem;int length;
}SqList;// 初始化
Status InitList_Sq(SqList &L) {L.elem = new int[MAXSIZE];if (!L.elem)exit(OVERFLOW);L.length = 0;return OK;
}// 遍历
void TraveList(SqList L)
{for (int i = 0; i < L.length; i++)cout << L.elem[i] << " ";cout << endl;
}void CreateList(SqList &L, int n)
{for (int i = 0; i < n; i++) {cin >> L.elem[i];L.length++;}
}void MergeList(SqList La, SqList Lb, SqList &Lc) {if (La.length > Lb.length)Lc.length = La.length;elseLc.length = Lb.length;int *pa = La.elem;int *pb = Lb.elem;Lc.elem = new int[Lc.length];int *pc = Lc.elem;int *pa_last = La.elem + La.length - 1;int *pb_last = Lb.elem + Lb.length - 1;while (pa <= pa_last && pb_last) *pc++ = *pa++ + *pb++;while (pa <= pa_last)*pc++ = *pa++;while (pb <= pb_last)*pc++ = *pb++;
}int main() {SqList La, Lb, Lc;InitList_Sq(La);InitList_Sq(Lb);InitList_Sq(Lc);CreateList(La, 5);CreateList(Lb, 7);MergeList(La, Lb, Lc);TraveList(Lc);return 0;
}