Cod sursa(job #819484)
Utilizator | Data | 19 noiembrie 2012 09:46:04 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.38 kb |
#include<stdio.h>
#include<string.h>
char x;
int w,ok,i,cnt,cnt2;
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
while(scanf("%c",&x)+1)
{
if(ok)
{
if((x>='a'&&x<='z')||(x>='A'&&x<='Z')) cnt++;
else ok=0;
}
else
{
if((x>='a'&&x<='z')||(x>='A'&&x<='Z')) {cnt2++;cnt++;ok=1;}
}
}
printf("%d\n",cnt/cnt2);
return 0;
}