Guest User

Code

a guest
Mar 6th, 2020
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1. #include <iostream>
  2. #define ushort unsigned short
  3. using namespace std;
  4.  
  5. int main() {
  6.   ushort n;
  7.   cin >> n;
  8.   short *a = (short*) calloc(n, sizeof(*a));
  9.   for(ushort i = 0; i < n; i++) cin >> a[i];
  10.   ushort d = 0;
  11.   for(ushort i = 1; i < n; i++) {
  12.     d += !(a[i-1] % 10) && !(a[i] % 10);
  13.   }
  14.   cout << d;
  15.   free(a);
  16. }
Add Comment
Please, Sign In to add comment