67 048
Assignments Done
99,3%
Successfully Done
In November 2018

Answer to Question #30899 in C++ for omer moiz

Question #30899
Write a Computer Program in c++ that Checks Whether a given Set is the Subset of another Set or Not?
Expert's answer
#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!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions