Cod sursa(job #608694)
Utilizator | Data | 17 august 2011 17:54:02 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.36 kb |
#include <fstream>
#include <ctype.h>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
char c;
int L,NR;
int main() {
while(!fin.eof()) {
fin.get(c);
if(isalpha(c)) {
while(!fin.eof() && isalpha(c)) {
L++;
fin.get(c);
}
NR++;
}
}
if(NR==0) {
fout << "0";
return 0;
}
fout << L/NR;
}