Cod sursa(job #187312)
| Utilizator | Data | 3 mai 2008 11:04:36 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.45 kb |
#include<fstream.h>
#include<stdio.h>
char c;
long nrc,l;
void citire()
{
int ok=0;
FILE *fin;
fin=fopen("text.in","r");
while(!feof(fin))
{
fscanf(fin,"%c",&c);
if(c>=65&&c<=90 || c>=97&&c<=122)
{
if(!ok)
{nrc++; ok=1;}
l++;
}
else ok=0;
}
}
void afisare()
{
ofstream fout("text.out");
fout<<l/nrc;
fout<<'\n';
fout.close();
}
int main()
{
citire();
afisare();
return 0;
}