Cod sursa(job #1240367)
Utilizator | Data | 11 octombrie 2014 09:52:39 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.39 kb |
#include <fstream>
using namespace std;
char ch;
int W, L;
ifstream fin("text.in");
ofstream fout("text.out");
bool CheckLetter(char c) {
return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z');
}
int main() {
while (fin.get(ch)) {
if (CheckLetter(ch)) {
++W;
while (CheckLetter(ch)) {
++L;
fin.get(ch);
}
}
}
fout << L / W << "\n";
return 0;
}