Cod sursa(job #738352)
Utilizator | Binica Nicolae binic | Data | 20 aprilie 2012 14:12:34 |
---|---|---|---|
Problema | Text | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.4 kb |
#include<stdio.h>
#include<string.h>
int i,z,y,s,u;
char a[1000],x;
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
scanf("%c",&a[0]);
i=0;
x=a[0];
while(EOF)
{
if(x<='z'&&x>='a'||x<='Z'&&x>='A'){z++;s++;}
else if((x>'z'||x<'a'||x>'Z'||x<'A')&&s>0){s=0;u++;}
i++;
y=scanf("%c",&a[i]);
x=a[i];
if(y!=1)break;
}
printf("%d",z/u);
return 0;
}