Pagini recente » Solutii preONI 2007, Runda 4 | Cod sursa (job #2056845) | Cod sursa (job #126037) | Cod sursa (job #655743) | Cod sursa (job #359796)
Cod sursa(job #359796)
#include<cstdio>
int main()
{
char c1,c2;
int nl,nc;
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
c1=' ';
nc=0; nl=0;
while(scanf("%c", &c2)!=EOF)
{
if(c2=='\n')
{
if(( ( (int)c1>=65 && (int)c1<=90) || ( (int)c1>=97 && (int) c1<=122) ))
nc++;
printf("%d\n",(int)nl/nc);
return 0;
}
if(!( ( (int)c2>=65 && (int)c2<=90) || ( (int)c2>=97 && (int) c2<=122) ) && ( ( (int)c1>=65 && (int)c1<=90) || ( (int)c1>=97 && (int) c1<=122) ))
nc++;
else if(( ( (int)c2>=65 && (int)c2<=90) || ( (int)c2>=97 && (int) c2<=122) ))
nl++;
c1=c2;
}
if(( ( (int)c1>=65 && (int)c1<=90) || ( (int)c1>=97 && (int) c1<=122) ))
nc++;
printf("%d\n",(int)nl/nc);
return 0;
}