Cod sursa(job #1460296)
| Utilizator | Data | 12 iulie 2015 12:25:05 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.78 kb |
#include<cstdio>
#include<cstring>
using namespace std;
char s[2000002];
int nrc,nrl,n,i;
bool ok;
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
nrc=0;
nrl=0;
while(!feof(stdin))
{
ok=false;
scanf("%s\n",s);
n=strlen(s);
for(i=0;i<n;i++)
{
if((s[i]>='a'&&s[i]<='z')||(s[i]>='A'&&s[i]<='Z'))
{
if(ok==false)
{
ok=true;
nrc++;
}
nrl++;
}
else
{
ok=false;
}
}
if(feof(stdin))
{
break;
}
}
printf("%d\n",nrl/nrc);
}
