Cod sursa(job #245275)
Utilizator | Data | 17 ianuarie 2009 15:26:16 | |
---|---|---|---|
Problema | Text | Scor | 90 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.38 kb |
#include <iostream.h>
#include <fstream.h>
int main()
{
long nrcuv=0,len=0;
char ch='a',k=0;
fstream f("text.in",ios::in), g("text.out",ios::out);
while(!f.eof())
{ f.get(ch);
if(ch>='a'&&ch<='z'||ch>='A'&&ch<='Z'&&!f.eof())
{ k=1; len++; }
else
if(k==1)
{
k=0;
nrcuv++;
}
}
g<<len/nrcuv;
g.close();
f.close();
return 0;
}