Advertisement
sellmmaahh

OR-Br Rijeci Koje Imaju N Znakova

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