Cod sursa(job #1802494)
| Utilizator | Data | 10 noiembrie 2016 14:20:44 | |
|---|---|---|---|
| Problema | Text | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.89 kb |
#include <iostream>
using namespace std;
int main()
{
string s;
while ( !fin.eof() )
{
if ( fin.peek() == ' ' )
{
" fin.get();
s += ' ';
}
else
{
fin >> ch;
s += ch;
}
}
for ( i = 0; i < s.size(); ++i )
{
if ( isalpha( s[i] ) || s[i] == ' ' || s[i] == '-' ) rez += s[i];
}
istringstream st;
st.str( prov );
string ss;
while ( st >> ss )
{
sol.push_back( ss );
}
for ( j = 0 ;j < sol.size(); ++j )
{
lungime += sol[j].size();//fout << sol[j] << " ";
nrc++;
}
ok = (int)(lungime/nrc);
fout << ok << "\n";
return 0;
}
