Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- using namespace std;
- int m, i, x;
- bool verif(int v[101]) {
- while (v[i] <= x)
- if (x == v[i])
- return 0;
- else
- if (i != m)
- i++;
- return 1;
- }
- int main() {
- int v[101], j = 0, n, c = 0;
- ifstream f("BAC.TXT");
- f >> m >> n;
- for (i = 1; i <= m; i++)
- f >> v[i];
- i = 1;
- while (j < n) {
- f >> x; j++;
- if (verif(v)) {
- cout << x << ' ';
- c++;
- }
- }
- cout << endl << c << endl;
- f.close();
- system("pause");
- }
- /* 9 12
- 3 5 10 23 25 28 30 40 61
- 1 2 13 15 23 25 26 30 31 32 35 36 */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement