Cod sursa(job #74372)
| Utilizator | Data | 25 iulie 2007 12:08:32 | |
|---|---|---|---|
| Problema | Text | Scor | 90 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.5 kb |
#include<stdio.h>
#include<string.h>
#include<ctype.h>
char c; int nr=0,k=0;
void rezolvare(){
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
c=getc(stdin);
while(!isalpha(c)&&!feof(stdin))
c=getc(stdin);
while(!feof(stdin)){
if(isalpha(c)){
k++;
c=getc(stdin);
}
else{
while(!isalpha(c)&&!feof(stdin))
c=getc(stdin);
nr++;
}
}
printf("%d",k/nr);
fclose(stdout);
}
int main(){
rezolvare();
return 0;
}