Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TUT 10 ZAD 6
- #include <stdio.h>
- #include <string.h>
- char* tritacke(char* s)
- {
- char* pocetak = s;
- char* tacka, *kraj_rijeci;
- int ch = 0;
- while(*s != '\0') {
- if(*s == ' ' || s == pocetak) {
- while(*s == ' ')
- s++;
- while((*s >= 'a' && *s <= 'z')||(*s >= 'A' && *s <= 'Z')){
- ch++;
- s++;
- if(ch == 3) tacka = s;
- }
- if(ch<10){
- ch = 0;
- continue;
- }
- if(ch >= 10){
- *tacka = '.';
- tacka++;
- kraj_rijeci = tacka;
- while(*tacka++ = *s++);
- s = kraj_rijeci;
- ch = 0;
- continue;
- }
- }
- s++;
- }
- return pocetak;
- }
- int main()
- {
- char niz[] = "abcdefghij";
- printf("%s",tritacke(niz));
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement