Cod sursa(job #333759)
Utilizator | Data | 23 iulie 2009 19:28:37 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.5 kb |
#include <iostream.h>
#include <fstream.h>
int main()
{
ifstream f("text.in");
ofstream g("text.out");
char ch;
int len=0,k=0,i=0,cuv=0;
while (!f.eof())
{
f.get(ch);
if ( (ch>=97) && (ch<=122) || (ch>=65) && (ch<=90) )
{
len++;
if (k==0) cuv++;
k=1;
}
else k=0;
}
g<<len/cuv;
g.close();
f.close();
return 0;
}