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