fork download
  1. #include <iostream>
  2. #include <set>
  3. using namespace std;
  4.  
  5. int main() {
  6. int numbers[] = { 2, 6, 7, 4, 5, 4, 1, 8, 9, 0, 7, 4 };
  7.  
  8. cout << (sizeof(numbers) / sizeof(numbers[0]) - set<int>(cbegin(numbers), cend(numbers)).size()) << endl;
  9. }
Success #stdin #stdout 0s 3412KB
stdin
Standard input is empty
stdout
3