Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2020
361
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. Задача №112289. Сколько равно X?
  2.  
  3. #include <iostream>
  4. using namespace std;
  5.  
  6. int main() {
  7. int n, x;
  8. int count = 0;
  9. cin>>n;
  10.  
  11. int arr[n];
  12.  
  13. for (int i = 0; i < n; i++) {
  14. cin>>arr[i];
  15. }
  16. cin>>x;
  17. for (int i = 0; i < n; i++) {
  18.  
  19. if (arr[i] == x) {
  20. count++;
  21. }
  22.  
  23. }
  24. cout<<count;
  25. return 0;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement