Cod sursa(job #1299407)
Utilizator | Data | 23 decembrie 2014 17:12:12 | |
---|---|---|---|
Problema | Text | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.56 kb |
#include<stdio.h>
#include<string.h>
char x;
int ok,i,cnt,cnt2;
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
while(scanf("%c",&x))
{
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;
}