Advertisement
Josif_tepe

Untitled

Jan 21st, 2023
874
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.41 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. {
  8.     FILE * in = fopen("input.txt", "r");
  9.    
  10.     char niza[1000];
  11.    
  12.     while(fgets(niza, 100, in) != NULL) {
  13.         for(int i = 0; i < strlen(niza); i++) {
  14.             if(isdigit(niza[i])) {
  15.                 printf("%c", niza[i]);
  16.             }
  17.         }
  18.         printf("\n");
  19.     }
  20.    
  21.     return 0;
  22.  
  23. }
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement