Cod sursa(job #548298)
Utilizator | Data | 7 martie 2011 12:19:33 | |
---|---|---|---|
Problema | Text | Scor | 90 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.45 kb |
#include<stdio.h>
using namespace std;
FILE*in=fopen("text.in","r");
FILE*out=fopen("text.out","w");
char c1;
int nrlit,nrcuv,ok;
int main()
{
while(!feof(in))
{
fscanf(in,"%c",&c1);
if(c1>='A' && c1<='Z' || c1>='a' && c1<='z')
{
ok=1;
nrlit++;
}
else
if(ok==1)
{
nrcuv++;
ok=0;
}
}
fprintf(out,"%d",nrlit/nrcuv);
fclose(in);
fclose(out);
return 0;
}