Код:
#include<sstring>
int parse(const char* s)
{
*long wordlens = 0;
*int * *wordcount = 0;
*stringstream is(s);
*string st;
*while(is>>st) {
* * int last = st.size()-1;
* * switch (st[last]) {
* * * * case ',':
* * * * case '.':
* * * * * * if(last>0) {
* * * * * * * *wordlens += last;
* * * * * * * *wordcount ++;
* * * * * * }
* * }
*}
*return (double)wordlens/wordcount;
}
[s]Исправлено:
Prisoner, 4:47 22-05-2004[/s]