Advertisement
Guest User

Untitled

a guest
Nov 13th, 2019
117
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. #include <stdlib.h>
  3.  
  4. int main()
  5. {
  6. int broj, zbir;
  7. broj='0';
  8. zbir=0;
  9. while(zbir<30)
  10. {
  11. scanf("%c", &broj);
  12. if(broj=='!')
  13. {
  14. break;
  15. }
  16. else
  17. {
  18. if((broj>='0')&&(broj<='9'))
  19. zbir+=broj - '0';
  20. }
  21. printf("%d\n", zbir);
  22. }
  23.  
  24. return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement