Cod sursa(job #30101)
Utilizator | Data | 12 martie 2007 20:52:45 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.31 kb |
#include <fstream.h>
ifstream f("text.in");
ofstream g("text.out");
int main()
{
unsigned long cuv=0,lit=0,rez,gasit=0;
char c;
while (!f.eof())
{
f.get(c);
if (c==' '&&gasit||c=='-'&&gasit) cuv++;
if (c>='a'&&c<='z'||c>='A'&&c<='Z') {lit++;gasit=1;}
}
cuv++;
rez=lit/cuv;
g<<rez;
return 0;
}