Cod sursa(job #448760)
| Utilizator | Data | 4 mai 2010 17:56:12 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.4 kb |
#include <stdio.h>
using namespace std;
int main(void)
{char c;
int nr=0,lg=0;
FILE *fin=fopen("text.in","r");
FILE *fout=fopen("text.out","w");
while(!feof(fin))
{c=fgetc(fin);
if((c>='A' && c<='Z') || (c>='a' && c<='z'))
{while((c>='A' && c<='Z') || (c>='a' && c<='z'))
{lg++; c=fgetc(fin); }
nr++;
}
}
fprintf(fout,"%d",lg/nr);
fclose(fin); fclose(fout);
return 0;
}
