Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #define ushort unsigned short
- using namespace std;
- int main() {
- ushort n;
- cin >> n;
- short *a = (short*) calloc(n, sizeof(*a));
- for(ushort i = 0; i < n; i++) cin >> a[i];
- ushort d = 0;
- for(ushort i = 1; i < n; i++) {
- d += !(a[i-1] % 10) && !(a[i] % 10);
- }
- cout << d;
- free(a);
- }
Add Comment
Please, Sign In to add comment