Cod sursa(job #1190879)
Utilizator | Data | 25 mai 2014 20:33:00 | |
---|---|---|---|
Problema | Text | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.47 kb |
#include <cstdio>
using namespace std;
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
int sum=0,nr=0;
char ch,chl;
scanf("%c",&chl);
while(scanf("%c",&ch)!=EOF){
if((ch>='a' and ch<='z')or (ch>='A' and ch<='Z'))
sum++;
else
if((chl>='a' and chl<='z')or (chl>='A' and chl<='Z'))
nr++;
chl=ch;
}
printf("%d\n",sum/nr);
return 0;
}