Cod sursa(job #811854)
Utilizator | Data | 12 noiembrie 2012 23:57:05 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.41 kb |
# include <cstdio>
using namespace std;
int k,sum;
char c1,c2;
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
c1=' ';sum=k=0;
while( scanf("%c",&c2) )
{
if(((65<=c2)&&(c2<=90))||((97<=c2)&&(c2<=122)))sum++;
else if(((65<=c1)&&(c1<=90))||((97<=c1)&&(c1<=122)))k++;
c1=c2;
if(c2=='\n')break;
}
printf("%d\n",sum/k);
}