Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Copyright ITOIT Meditatii SRL
- * Lesson challenge
- */
- #include <cstdio>
- // Descrieti in limbaj natural ce face programul de mai jos.
- int main()
- {
- int v[20], n, s = 0;
- scanf("%d", &n);
- for(int i = 0; i < n; ++i)
- scanf("%d", &v[i]);
- for(int i = 0; i < n; ++i)
- if(v[i] % 2 == 0)
- s += v[i];
- printf("%d", s);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement