2013-05-20T14:58:28-04:00
Write a Computer Program in c++ that Checks Whether a given Set is the Subset of another Set or Not?
1
2013-05-22T10:36:19-0400
#include <iostream> #include <memory.h> #include <stdio.h> #include <cstdlib> #include <algorithm> using namespace std; int n, m; int a[10000]; int b[10000]; void read(int A[], int &x) { cin >> x; for (int i = 0; i < x; i++) & cin >> A[i]; } int main() { freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); read(a, n); read(b, m); sort(a, a + n); sort(b, b + m); cout << includes(a, a + n, b, b + m); return 0; }
Need a fast expert's response?
Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS !
Learn more about our help with Assignments:
C++
Comments