Odpowiedź:
#include<iostream>
#include<algorithm>
int fun(int *tab, int n) {
int size = sizeof(tab) / tab[0];
return std::count(tab, tab + size, n);
}
int main() {
int tab[] = {1, 2, 3, 4, 5, 5, 5, 6};
int n = 5;
std::cout << fun(tab, n);
return 0;
Wyjaśnienie:
" Life is not a problem to be solved but a reality to be experienced! "
© Copyright 2013 - 2025 KUDO.TIPS - All rights reserved.
Odpowiedź:
#include<iostream>
#include<algorithm>
int fun(int *tab, int n) {
int size = sizeof(tab) / tab[0];
return std::count(tab, tab + size, n);
}
int main() {
int tab[] = {1, 2, 3, 4, 5, 5, 5, 6};
int n = 5;
std::cout << fun(tab, n);
return 0;
}
Wyjaśnienie: