Cod sursa(job #577764)
Utilizator | Data | 10 aprilie 2011 16:21:45 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.36 kb |
#include<fstream>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int lg,nrc,ok;
char s[300],*p,x;
int main()
{
ok=nrc=0;
while(f.get(x))
{
if((x<='z'&&x>='a')||(x<='Z'&&x>='A'))
{
lg++;
ok=1;
}
else
if(ok==1)
{
nrc++;
ok=0;
}
}
if(ok)
nrc++;
g<<int(lg/nrc);
return 0;
}