Advertisement
Guest User

Untitled

a guest
Sep 21st, 2019
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.36 KB | None | 0 0
  1. ///all delete except lowercase
  2.  
  3. #include<stdio.h>
  4. #include<string.h>
  5. #include<math.h>
  6.  
  7.  
  8. char a[100],b[100];
  9.  
  10. void dlt(int pos)
  11. {
  12.     int i=pos;
  13.     while(a[i]!='\0')
  14.     {
  15.         a[i]=a[i+1];
  16.         i++;
  17.     }
  18. }
  19.  
  20.  
  21. int main()
  22. {
  23.     gets(a);
  24.  
  25.     int i=0;
  26.  
  27.     while(a[i]!='\0')
  28.     {
  29.         if(a[i]>='a' && a[i]<='z') i++;
  30.         else dlt(i);
  31.     }
  32.    
  33.     puts(a);
  34.    
  35.     return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement