Cod sursa(job #2071522)
Utilizator | Data | 20 noiembrie 2017 19:06:38 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.5 kb |
#include <fstream>
using namespace std;
ifstream fin ("text.in");
ofstream fout ("text.out");
bool e (char c)
{
if (c>='a'&&c<='z')
return true;
if (c>='A'&&c<='Z')
return true;
return false;
}
int main()
{
int n=0,S=0,l=0;
char c;
while (fin.get(c)) {
if (e(c))
++l;
else{
if (l>0)
++n,S+=l;
l=0;
}
}
if (l)
++n,S+=l;
fout<<S/n;
return 0;
}