Cod sursa(job #424821)
| Utilizator | Data | 25 martie 2010 11:11:42 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.5 kb |
#include<cstring>
#include<fstream>
using namespace std;
int main()
{
freopen("text.in","r",stdin);
ofstream fout("text.out");
int nrc=0, nrl=0,last=0, acum;
char ch;
while(scanf("%c", &ch)!=EOF)
{
if((ch>='a' && ch<='z') || (ch>='A' && ch<='Z'))
{
nrl++;
acum=1;
}
else
acum=0;
if(last==0 && acum==1)
nrc++;
last=acum;
}
fout<<nrl/nrc;
return 0;
}
