Cod sursa(job #266399)
| Utilizator | Data | 25 februarie 2009 13:41:17 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.36 kb |
//http//infoarena.ro/problema/text
#include<string.h>
#include<stdio.h>
int main()
{
FILE *f;
f=fopen("text.in","r");
freopen("text.out","w",stdout);
int l,i,cuv=0,car=0;
char s,c=' ';
while(fscanf(f,"%c",&s)!=EOF){
if(s>='a'&&s<='z'||s>='A'&&s<='Z'){car++;
if(!(c>='a'&&c<='z'||c>='A'&&c<='Z'))cuv++;
}
c=s;
}
printf("%d",car/cuv);
return 0;
}