Pagini recente » Cod sursa (job #866587) | Cod sursa (job #3275696) | Cod sursa (job #285716) | Cod sursa (job #98272) | Cod sursa (job #2635603)
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin ("text.in");
ofstream fout ("text.out");
long long nr_cuvinte, litere;
bool cuvant = false;
int main() {
char el;
while (!fin.eof()){
fin.get(el);
if ((el >= 'a' && el <= 'z') || (el >= 'A' && el <= 'Z')) {
if (!cuvant)
++nr_cuvinte;
++litere;
cuvant = true;
}
else
cuvant = false;
}
fout << litere / nr_cuvinte;
return 0;
}