1.
#include <iostream>
using namespace std;
int main()
{
int x[101],y[101],m,n,i,j;
cin>>m>>n;
for (i=1; i<=m; i++)
cin>>x[i];
for (j=1; j<=n; j++)
cin>>y[i];
for (i=1; i<=m; i++)
for (j=1; j<=n; j++)
if (x[i]==y[j])
cout << x[i] << " ";
return 0;
}
2.
#include <iostream>
using namespace std;
int main()
{
int a[101],n,i,x,ok=0;
cin>>n;
for (i=1; i<=n; i++)
cin>>a[i];
cin>>x;
i=1;
while (i<=n)
{
if (x==a[i])
{
cout << "Da";
ok=1;
}
i++;
}
if (ok==0)
cout << "Nu";
return 0;
}