Cod sursa(job #1338536)
Utilizator | Data | 10 februarie 2015 08:57:53 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.48 kb |
#include<stdio.h>
#include<cstring>
using namespace std;
char s[1000001];
int main(){
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
int n,l=0,nr=0,pp=0,i;
gets(s);
n=strlen(s);
for(i=0;i<n;i++)
if((s[i]>='a'&&s[i]<='z')||(s[i]>='A'&&s[i]<='Z')){
l++;
if(pp==0){
nr++;
pp=1;
}
}
else
pp=0;
printf("%d",l/nr);
return 0;
}