Cod sursa(job #517174)
| Utilizator | Data | 28 decembrie 2010 00:05:49 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.38 kb |
#include<fstream>
using namespace std;
int lg,nrc,ok;
char s[300],*p,x;
int main()
{
ifstream f("text.in");
ofstream g("text.out");
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<<lg<<" "<<nrc<<"\n";
g<<int(lg/nrc);
return 0;
}