Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(){
- int zbir=0,prethoden=0;
- char c;
- while(scanf("%c",&c)&&c!='!'){
- if(c=='0'||c=='1'||c=='2'||c=='3'||c=='4'||c=='5'||c=='6'||c=='7'||c=='8'||c=='9'){
- prethoden = prethoden*10 + c - '0';
- }
- else{
- zbir += prethoden;
- prethoden = 0;
- }
- }
- zbir +=prethoden;
- printf("%d",zbir);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement