Guest User

Untitled

a guest
May 24th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. char mreza (char *p)
  5. {
  6. while (*p!='\0')
  7. {
  8. 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)
  9. return (*(p+2));
  10. else
  11. return '0';
  12. }
  13. }
  14. int main()
  15. {
  16. char a[20];
  17. printf("Unesi broj telefona: ");
  18. scanf("%s", a);
  19. printf("%c", mreza(a));
  20. return 0;
  21. }
Add Comment
Please, Sign In to add comment