Cod sursa(job #398652)
| Utilizator | Data | 19 februarie 2010 09:25:16 | |
|---|---|---|---|
| Problema | Text | Scor | 60 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.41 kb |
#include<stdio.h>
int main()
{
freopen ("text.in", "r", stdin);
freopen ("text.out", "w", stdout);
char c;
int l=0, k=0, r, z=0;
while(scanf("%c", &c)!=EOF){
if('a'<=c && c<='z' || 'A'<=c && c<='Z'){
l++;
z=1;
}
if(z==1){
if(c==' ' || c=='-' || c=='!' || c=='?' || c=='.' || c==',' ||c==':' || c==';'){
k++;
z=0;
}
}
}
r=l/k;
printf("%d", r);
return 0;
}