Cod sursa(job #785828)
| Utilizator | Data | 9 septembrie 2012 22:07:08 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | pregatire-monthly8-ziua1 | Marime | 0.37 kb |
#include<fstream>
#include<cstdio>
#include<cstring>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int i,n,nrl=0,nrcuv=0,ok=0;
char c;
int main()
{
f.get(c);
while(!f.eof())
{if(c>='a'&&c<='z' ||c>='A'&&c<='Z')
{++nrl;
ok=1;
}
else
if(ok==1)
{++nrcuv;ok=0;}
f.get(c);
}
g<<nrl/nrcuv;
return 0;
}