Cod sursa(job #1040640)
Utilizator | Data | 24 noiembrie 2013 18:47:13 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.5 kb |
#include<stdio.h>
int main()
{
int OK,nrcuv=0,nrlit=0,sum;
char c;
FILE *f=fopen("text.in","r");
FILE *g=fopen("text.out","w");
OK=0;
while (!feof(f))
{
fscanf (f,"%c",&c);
if ((c>='a'&&c<='z')||(c>='A'&&c<='Z'))
if (OK==0)
{
nrcuv++;
OK=1;
nrlit++;
}
else
{
nrlit++;
}
else
OK=0;
}
fprintf (g,"%d",nrlit/nrcuv);
return 0;
}