Cod sursa(job #145534)
Utilizator | Data | 28 februarie 2008 21:53:51 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.33 kb |
#include <stdio.h>
char h,ch;
int main()
{
int e=0,i,nrca=0,nrcuv=0;
freopen("text.in", "r",stdin);
freopen("text.out", "w",stdout);
while(scanf("%c", &ch) )
{
if(ch==h) ++e;
if((ch>65 && ch<91) || (ch>96 && ch<123))
{++nrca; if(h==32 || h==45) ++nrcuv;}
if(e>4) break;
h=ch;
}
printf("%d",nrca/nrcuv);
return 0;
}