Guest User

Untitled

a guest
Jul 16th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. #include <ctype.h>
  5. int main()
  6. {
  7. char *s,*p;
  8. int i,k=0;
  9. s="+,- 1234";
  10. p=malloc(strlen(s));
  11. for (i = 0; i < strlen(s); i++){
  12. if (s[i] >= '0' && s[i] <= '9')
  13. p[k++] = s[i];
  14.  
  15. }
  16. printf("+%s\n",p);
  17. printf("-%s",p);
  18. return 0;
  19. }
Add Comment
Please, Sign In to add comment