Cod sursa(job #1167892)
| Utilizator | Data | 6 aprilie 2014 11:03:24 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | c | Status | done |
| Runda | Arhiva de probleme | Marime | 0.56 kb |
#include <stdio.h>
int main()
{
FILE *fin, *fout;
int nrcuv=0,n,tot=0,incuv=0;
char c;
fin=fopen("text.in","r");
fout=fopen("text.out","w");
c=fgetc(fin);
while(c!=EOF)
{
if((c>='a' && c<='z') || (c>='A' && c<='Z'))
{
tot++;
incuv=1;
}
else
if(incuv==1)
{
incuv=0;
nrcuv++;
}
c=fgetc(fin);
}
fprintf(fout,"%d\n",tot/nrcuv);
fclose(fin);
fclose(fout);
return 0;
}
