Advertisement
Guest User

Untitled

a guest
Nov 14th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. #include <stdio.h>
  2. int main()
  3. {
  4. char c;
  5. int zbir=0,i=0;
  6. scanf(" %c",&c);
  7. while(c!='!')
  8. {
  9. if(c>='0' && c<='9')
  10. {
  11. i++;
  12. if(i==1)
  13. {
  14. zbir+=(int)c-48;
  15. }
  16. }
  17. else
  18. {
  19. i=0;
  20. }
  21. scanf(" %c",&c);
  22. }
  23. printf("%d",zbir);
  24. return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement