Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- int main(int argc, char *argv[])
- {
- if (argc > 0)
- {
- char *input = argv[1];
- int len = strlen(input);
- char *buf = malloc((len * sizeof(char)) + 1);
- int i = 0, j = 0;
- for (; i < len; i++)
- {
- char c = input[i];
- if (c >= 48 && c <= 57)
- buf[j++] = c;
- }
- buf[j] = '\0';
- printf("%s\n", buf);
- free(buf);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement