Advertisement
DatProgrammer

P14130

Dec 8th, 2015
632
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.26 KB | None | 0 0
  1. #include <iostream>
  2. #include <vector>
  3. using namespace std;
  4.  
  5. int main() {
  6.  
  7.   int n;
  8.   cin >> n;
  9.   vector<int> v(n);
  10.   int count = 0;
  11.   for (int i = 0; i < n; ++i) cin >> v[i];
  12.   for (int i = 0; i < n-1; ++i) if (v[i] == v[n-1]) ++count;
  13.   cout << count << endl;
  14.  
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement