fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int arr[10] = {9,1,2,2,3,4,2,1,4,5};
  6. int query[4] = {5,2,3,1};
  7.  
  8. for(int i = 0 ; i < 4 ; i++){
  9. int cnt = 0;
  10. for(int j = 0 ; j < 10 ; j++){
  11. if(arr[j] == query[i])
  12. cnt++;
  13. }
  14. cout<<cnt<<endl;
  15. }
  16. return 0;
  17. }
Success #stdin #stdout 0.01s 5280KB
stdin
Standard input is empty
stdout
1
3
1
2