Cod sursa(job #380454)
| Utilizator | Data | 6 ianuarie 2010 10:36:26 | |
|---|---|---|---|
| Problema | Text | Scor | 90 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.48 kb |
#include<cstdio>
#include<cstdlib>
using namespace std;
#define FIN "text.in"
#define FOUT "text.out"
int main()
{FILE *fi=fopen(FIN,"r");
FILE *fo=fopen(FOUT,"w");
char c;
long long contor=0,lg=0,curent=0;
while(fscanf(fi,"%c", &c)!=EOF)
{if(('a'<=c && c<='z')||('A'<=c && c<='Z'))
{lg++;
if(curent==0) curent=1;
}
else {if(curent==1) {curent=0;contor++;}
}
}
fprintf(fo,"%ld",lg/contor);
return 0;}
