Pagini recente » Statistici Bogdan Ionescu (BogdanIonesq) | Cod sursa (job #415283) | Cod sursa (job #417847) | Borderou de evaluare (job #2571178) | Cod sursa (job #1240367)
#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;
}