Cod sursa(job #1194435)
Utilizator | Data | 3 iunie 2014 21:42:02 | |
---|---|---|---|
Problema | Dtcsu | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.45 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=NULL;
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;
}