Josif_tepe

Untitled

Aug 26th, 2026
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.54 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <ctype.h>
  4. #include <math.h>
  5.  
  6.  
  7. void otstrani_cifri(char * s) {
  8.  
  9.     char niza_bez_cifri[2000];
  10.     int j = 0;
  11.  
  12.     for(int i = 0; i < strlen(s); i++) {
  13.         if(!isdigit(s[i]))  {
  14.             niza_bez_cifri[j] = s[i];
  15.             j++;
  16.         }
  17.        
  18.     }
  19.  
  20.     printf("Vneseniot tekst e %s\n", s);
  21.     printf("Izmenetitot tekst bez cifri e %s\n", niza_bez_cifri);
  22.  
  23. }
  24.  
  25. int main(int argc, char * argv[]) {
  26.    
  27.     char s[2000];
  28.     gets(s);
  29.  
  30.     otstrani_cifri(s);
  31. }
  32.  
  33.  
  34.  
  35.  
Advertisement
Add Comment
Please, Sign In to add comment