0
I'm doing a function that identifies me how many times an element is found in a vector, what condition should I put?
#include<iostream> using namespace std; int repeat(int num[], int n){ int can = 0; for(int i=0; i < 5; i++){ if(num[i] == num[i]){ } cout << num[i]; } } int main(){ int vec[5]={1,1,3,7,5}; cout << "number repeat " << endl; repeat(vec,5); }
2 Respuestas