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 == '!') {
- break;
- }
- if(c >= '0' && c <= '9') { // znakot e cifra
- broj = (broj * 10) + (c - '0');
- }
- else {
- zbir += broj;
- broj = 0;
- }
- }
- zbir += broj;
- printf("%d\n", zbir);
- return 0;
- }
- ///dsadas34D fsdmflk12dfskl fsdsfd41mewm20!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement