Cod sursa(job #271263)
| Utilizator | Data | 5 martie 2009 06:17:33 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.51 kb |
#include<stdio.h>
#include<string.h>
int az(char a)
{
if(a>='a'&&a<='z') return 1;
return 0;
}
int AZ(char a)
{
if(a>='A'&&a<='Z') return 1;
return 0;
}
int main()
{
int nc=0,i,nl=0,ok=0,ans,n=0;
char ch;
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
while(scanf("%c",&ch)!=EOF)
if(az(ch)||AZ(ch))
{
nl++;
if(!ok) nc++;
ok=1;
}
else ok=0;
ans=nl/nc;
printf("%d\n",ans);
return 0;
}
