Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdlib.h>
- #include <stdio.h>
- #include <string.h>
- #include <ctype.h>
- int main(int argc, char *argv[]) {
- char text[] = "aoai 1skkfd 34kdwn 99";
- size_t len = strlen(text);
- char digits[10];
- memset(digits, 0, 10);
- printf("Digits: ");
- for (size_t i = 0; i < len; ++i) {
- char c = text[i];
- if (isdigit(c)) {
- digits[c - '0'] = 1;
- printf("%c", c);
- }
- }
- printf("\n");
- return EXIT_SUCCESS;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement