Cod sursa(job #316927)
| Utilizator | Data | 21 mai 2009 16:49:08 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | c | Status | done |
| Runda | Arhiva de probleme | Marime | 0.41 kb |
#include<stdio.h>
#include<string.h>
#include<ctype.h>
#define NMax 1024*1024
char text[NMax];
int main()
{FILE *f=fopen("text.in","r"),*g=fopen("text.out","w");
long long lcuv=0,ncuv=0,cuv=0;
char c;
while(fscanf(f,"%c",&c)==1)
if(isalpha(c))
if(!cuv)
{ncuv++;lcuv++;cuv=1;}
else lcuv++;
else cuv=0;
fprintf(g,"%lld",lcuv/ncuv);
fclose(f);
fclose(g);
return 0;
}
