Cod sursa(job #610101)
Utilizator | Data | 24 august 2011 21:35:08 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.34 kb |
#include<fstream>
#include<string>
using namespace std;
int main()
{
ifstream f("text.in");
ofstream g("text.out");
int l=0,w=0;
char c;
while(!f.eof())
{
f.get(c);
if(isalpha(c))
{
while(!f.eof() && isalpha(c))
{
l++;
f.get(c);
}
w++;
}
}
f.close();
g<<int(l/w);
g.close();
return 0;
}