Pagini recente » Cod sursa (job #871428) | Cod sursa (job #876493) | Cod sursa (job #1508695) | Cod sursa (job #615607) | 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;
}