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