Cod sursa(job #900432)
Utilizator | Data | 28 februarie 2013 19:37:18 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.36 kb |
#include<cstdio>
#include<string.h>
using namespace std;
FILE *f=fopen("text.in","r");
FILE *g=fopen("text.out","w");
int i,nr,dim,OK;
char c;
int main ()
{
while(fscanf(f,"%c",&c)!=EOF)
{
if((c>='a'&&c<='z')||(c>='A'&&c<='Z'))
{
OK=1;
dim++;
}
else
if(OK)
{
nr++;
OK=0;
}
}
fprintf(g,"%d",dim/nr);
return 0;
}