Cod sursa(job #848127)
Utilizator | Data | 4 ianuarie 2013 21:34:38 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.39 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream f ("text.in");
ofstream g ("text.out");
int main ()
{
char x;
int l=0, s=0, n=0;
// while (f>>x)
while (f.get(x))
{
if (('a'<=x && x<='z') || ('A'<=x && x<='Z')) l++;
else
{
if (l) n++;
s+=l; l=0;
}
}
// cout<<n;
g<<s/n;
}