Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int main(){
- char c;
- int broj = 0;
- int zbir = 0;
- while(scanf("%c", &c)) {
- if(c >= '0' && c <= '9') {
- broj = (broj * 10) + (c - '0');
- }
- else {
- if(broj % 2 == 0) {
- zbir += broj;
- }
- broj = 0;
- }
- if(c == '!') {
- break;
- }
- }
- printf("%d\n", zbir);
- return 0;
- }
- // a123b422c900!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement