Advertisement
sellmmaahh

OR-Izbaci Rijec sa >= 3 samogl. pok1

Aug 14th, 2015
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.90 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3.  
  4. int Izbaci (char *s)
  5. {   int br_samogl=0;
  6.     char *p=s;
  7.     while (*s!='\0') {
  8.             if ((tolower(*s)>='a' && tolower(*s)<='z' && *(s-1)==' ') || (tolower(*s)>='a' && tolower(*s)<='z' && s==p )) {
  9.             char *poc=s;
  10.             while (*s!=' ') {
  11.                     if (tolower(*s)=='a' || tolower(*s)=='e' || tolower(*s)=='i' || tolower(*s)=='o' || tolower(*s)=='u')
  12.                     br_samogl++;
  13.                s++; }
  14.                char *kraj=s;
  15.                poc--;
  16.             if (br_samogl>=3) {
  17.                 while (*kraj!='\0') {
  18.                         *poc++=*kraj++;
  19.                 }}
  20.                    while (*p!='\0') p++;
  21.                 *(p-(kraj-poc))='\0';
  22.             }
  23.             else s++;
  24.             br_samogl=0;
  25.     }}
  26.  
  27.  
  28. int main () {
  29.     char s[]="Ovo je recenica. ";
  30.        Izbaci(s);
  31.        printf("%s",s);
  32.     return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement