[Init] Solved solutions

This commit is contained in:
2023-03-02 20:58:03 +07:00
parent 51f667ac81
commit 20542601dd
131 changed files with 4148 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
#include <iostream>
using namespace std;
bool b[10];
int main()
{
unsigned short n, m;
cin >> n >> m;
int *a = new int[n];
for (unsigned short i = 0; i < n; i++)
{
cin >> a[i];
}
for (unsigned short i = 0; i < m; i++)
{
int t;
cin >> t;
b[t] = 1;
}
for (unsigned short i = 0; i < n; i++)
{
if (b[a[i]] == 1)
{
cout << a[i] << " ";
}
}
delete[] a;
a = NULL;
return 0;
}