Cod sursa(job #50455)
Utilizator | Data | 7 aprilie 2007 19:03:24 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.49 kb |
#include <fstream.h>
#include <stdio.h>
#include <ctype.h>
FILE *f=fopen("text.in","r");
ofstream g("text.out");
char a;
long long s,c;
int main(){
while(!feof(f)){
a= fgetc(f);
if(isalpha(a)){c++;
while(isalpha(a)){s++; a= fgetc(f); }
}
// g<<a;
}
g<<s/c;
fclose(f);
g.close();
return 0;
}