Cod sursa(job #2635603)
| Utilizator | Data | 14 iulie 2020 23:28:25 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.53 kb |
#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;
}
