#include <iostream> using namespace std; int main() { int a[] = {1, 2, 3, 4}; int b[] = {0, 1, 5, 6}; for (int i=0;i<4;i++) { for (int j=0;j<4;j++) { if (a[i] > b[j]) { cout << a[i] << " | "; } else if (a[i] < b[j]) { cout << b[j] << " | "; break; } } } return 0; }
1 | 2 | 5 | 6 |
1 | 5 | 2 | 2 | 5 | 3 | 3 | 5 | 4 | 4 | 5 |
a[]
b[]
for
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)