Cod sursa(job #645588)
Utilizator | Data | 9 decembrie 2011 22:49:51 | |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.24 kb |
#include<iostream.h>
#include<string.h>
int main()
{
int nr=0,n=0;
char s[100],*p,sep[]=" ";
cin.get(s,100);
cin.get();
p=strtok(s,sep);
while(p)
{
nr=nr+strlen(p);
p=strtok(NULL,sep);
n++;
}
cout<<nr/n;
return 0;
}