Advertisement
Guest User

Untitled

a guest
Jun 25th, 2017
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.55 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3.  
  4. void rm_digits(char *p){
  5.   int found=0;
  6.   while(*p){
  7.     if( (*p>=48)&&(*p<=57) ){
  8.       char *zahl = malloc(sizeof(4));
  9.       zahl=p;
  10.       while( (*zahl!=32) && (*zahl!=46) ){
  11.     printf("%c",*zahl);
  12.     zahl++;
  13.       }
  14.       found++;
  15.       p = zahl;
  16.       free(zahl);
  17.       printf("%c",32);
  18.     }
  19.     p++;
  20.   }
  21. }
  22.  
  23. int main(int argc,char *argv[]){
  24.  
  25.   char satz []= "Die 17 ist eine bessere Basis der reellen Zahlen als die 42 oder die 123.";
  26.   char *s = satz;
  27.  
  28.   rm_digits(s);
  29.  
  30.   return 0;
  31.  
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement