Cod sursa(job #60746)
Utilizator | Data | 16 mai 2007 13:30:21 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.36 kb |
#include <fstream.h>
#include <iomanip.h>
ifstream f("text.in");
ofstream g("text.out");
int ok;
unsigned long lung,cuv;
int main()
{char x;
while(f>>resetiosflags(ios::skipws)>>x)
{if(((x>='a')&&(x<='z'))||((x>='A')&&(x<='Z'))){lung++;
if(!ok){ok=1;cuv++;}
}
else ok=0;
}
f.close();
g<<lung/cuv<<'\n';
g.close();
return 0;
}