Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <ctype.h>
- int main()
- {
- char *s,*p;
- int i,k=0;
- s="+,- 1234";
- p=malloc(strlen(s));
- for (i = 0; i < strlen(s); i++){
- if (s[i] >= '0' && s[i] <= '9')
- p[k++] = s[i];
- }
- printf("+%s\n",p);
- printf("-%s",p);
- return 0;
- }
Add Comment
Please, Sign In to add comment