Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int NajveciBroj (char *s) {
- int i, nb=0, max_broj=0;
- while (*s!='\0') {
- if (*s>='0' && *s<='9') {
- nb=nb*10+(*s-'0');
- s++;
- while (*s>='0' && *s<='9') {
- nb=nb*10+(*s-'0');
- s++;
- }
- if (nb>max_broj) {
- max_broj=nb;
- }
- nb=0;
- }
- else {
- s++;
- }
- }
- return max_broj;
- }
- int main () {
- char s[]="123ab45CD678E9";
- printf("%d", NajveciBroj(s));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement