Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- char mreza (char *p)
- {
- while (*p!='\0')
- {
- if (*p==48 && *(p+1)==54 && *(p+2)>=48 && *(p+2)<=57 && *(p+3)==47 && *(p+4)>=48 && *(p+4)<=57 && *(p+5)>=48 && *(p+5)<=57 && *(p+6)>=48 && *(p+6)<=57 && *(p+8)>=48 && *(p+8)<=57 && *(p+9)>=48 && *(p+9)<=57 && *(p+10)>=48 && *(p+10)<=57)
- return (*(p+2));
- else
- return '0';
- }
- }
- int main()
- {
- char a[20];
- printf("Unesi broj telefona: ");
- scanf("%s", a);
- printf("%c", mreza(a));
- return 0;
- }
Add Comment
Please, Sign In to add comment