Cod sursa(job #444664)
Utilizator | Data | 21 aprilie 2010 10:10:51 | |
---|---|---|---|
Problema | Text | Scor | 90 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.36 kb |
# include <fstream>
# include <iostream>
using namespace std;
int main ()
{
char c;
ifstream fin ("text.in");
ofstream fout ("text.out");
int nrcuv=0, nrc=0, am=0;
c=fin.get();
while (c!=EOF)
{
if ((c>='a' && c<='z') || (c>='A' && c<='Z'))
am=1, ++nrc;
else
if (am)++nrcuv, am=0;
c=fin.get();
}
fout<<nrc/nrcuv;
return 0;
}