#include <stdio.h>
#include <string.h>

char * infmaxw(const char * s,char* slmax,int & maxl,int & maxnum)
{  char slovo[15];int j,kols,dls;size_t i;
   kols=0;dls=0;slmax[0]='\0';maxl=0;maxnum=0;j=0;
   for(i=0;i<=strlen(s);i++)
   {
       if ((s[i]==' ')||(s[i]=='\0'))
        { kols=kols+1;
          slovo[j]='\0';
          if (dls>maxl)
           { maxl=dls;
            maxnum=kols;
            strcpy(slmax,slovo);
           }
          slovo[0]='\0';
          j=0; dls=0;
       }
       else
       { dls++;
         slovo[j++]=s[i];
       }
    }
       return slmax;
}
int main(int, char**)
{char st[80],maxsl[15];
    int maxn,maxlen;
puts("input string : world and space");
gets(st);
printf("V stroke slovo ");
printf("""%s"" - macsimalno \n",infmaxw(st,maxsl,maxlen,maxn));
puts("input string : world and space");
gets(st);
infmaxw(st,maxsl,maxlen,maxn);
printf("V stroke slovo ");
printf("""%s"" - macsimalno \n   Number=%4d   Legth= %4d\n", maxsl,maxn,maxlen);
    return 0;
}
