Cod sursa(job #1454348)
| Utilizator | Data | 26 iunie 2015 11:12:03 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| 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)+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;
}
