Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- int Uradi(char* string)
- {
- int n=0,brojac=0;
- char* s=string;
- int i;
- while (*s != '\0')
- {
- if(*s>='0' && *s<='9')
- {
- brojac=0;
- while(*s!=0 && *s>='0' && *s<='9')
- {
- if(*s>='0' && *s<='9')
- {
- brojac++;
- s++;
- }
- }
- }
- if(brojac==3)
- {
- s-=3;
- for(i=0; i<3; i++)
- {
- n*=10;
- n+=(int)(*s-'0');
- s++;
- }
- return n;
- }
- s++;
- }
- }
- int main()
- {
- printf("%d",Uradi("kako je to1234 768 123<- ćek za prvu"));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement