MarioDB/lotto.cpp

32 lines
497 B
C++
Raw Normal View History

2025-01-22 18:49:14 +00:00
#include <iostream>
using namespace std;
int main()
{
int a[] = {5, 3, 2, 2, 9, 1};
int i,dl,n;
dl=sizeof(a)/sizeof(a[0]);
for(i=0;i<dl;i++)
cout<<a[i]<<" ";
cout<<"\n n = ";
cin>>n;
int *b = new int [n];
for(i=0;i<n;i++) {
cout<<"b["<<i<<"]=";
cin>>b[i];
}
int k=0;
for(i=0;i<dl;i++) {
if(a[i]==b[0]) k++;
}
cout<<"\n\t k = "<<k;
system("pause > null");
return 0;
}