Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- int n;
- while (cin >>n) {
- int ant;
- cin >>ant;
- int suma=0;
- for (int i=1;i<n;++i) {
- int act;
- cin >>act;
- if (act%2==0) suma+=ant;
- ant=act;
- }
- cout <<suma<<endl;
- }
- }
- //By Patata
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement