Cod sursa(job #786011)
Utilizator | Data | 10 septembrie 2012 12:54:54 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.38 kb |
#include<cstdio>
#include<cstring>
#include<ctype.h>
char c,cc;
int p,n,m,i,j;
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
scanf("%c",&c);
while(cc!=c)
{
if(isalpha(c))
{
p=1;
m++;
i=0;
}
else
if(p==1)
{
n++;
p=0;
}
cc=c;
scanf("%c",&c);
}
printf("%d",m/n);
return 0;
}