#include <iostream>
using namespace std;
int main() {
const int n = 50 ;
int a[n] , b[n];
for (size_t i = 0 ; i < n ; i++){
a[i] = rand() % 100 ;
cout << a[i] << " ";
}
cout << "Введите число k" << endl ;
int k ;
cin >> k ;
int x = 0 ;
for (size_t i = 0 ; i < n ; i++){
if (a[i] % 10 == k){
b[x] = a[i];
x++;
}
}
for (size_t i = 0 ; i < x ; i++){
cout << b[i] << " ";
}
return 0;
}