C ++ click -- {A} + {B} to add A set
Problem Description gives you two sets. {A} + {B} is required }.
Note: there will not be two identical elements in the same set. Input each group of Input data is divided into three rows, the first row has two numbers n, m (0 Output outputs a row of data for each group of data, indicating the merged set, which must be Output from small to large. Each element is separated by a space. Sample Input
1 212 31 211 2
Sample Output
1 2 31 2
/* Copyright (c) 2014, School of Computer Science, Yantai University * All rights reserved. * file name: test. cpp * Prepared by: Chen Danni * completion date: May 24, 2015 * version No.: v1.0 */# include
Using namespace std; int main () {int n, m, I, j, a [20002], B [20002], t; while (cin> n> m) {for (I = 0; I
> A [I]; for (I = 0; I
A [j + 1]) {t = a [j]; a [j] = a [j + 1]; a [j + 1] = t ;} B [0] = a [0]; j = 0; for (I = 1; I
Experience: I have been doing this question for a long time. If anyone has a better solution, please let me know. Thank you! Continue to work!