Cod sursa(job #583744)
| Utilizator | Data | 22 aprilie 2011 13:19:11 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.44 kb |
#include <fstream>
#include <iostream>
#include <string>
using namespace std;
int main()
{
ifstream f("text.in");
ofstream g("text.out");
char a;
int total_len=0,nr=0;
while(!f.eof())
{
a=f.get();
if( (a>='a' && a<='z') || (a>='A' && a<='Z') )
{
while( (a>='a' && a<='z') || (a>='A' && a<='Z') )
{
total_len++;
a=f.get();
}
nr++;
}
}
g<<total_len/nr;
return 0;
}