Cod sursa(job #2422381)
| Utilizator | Data | 18 mai 2019 16:18:23 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.4 kb |
#include<fstream>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int main() {
int cuv = false;
char c;
int cuvinte = 0, total = 0;
while (fin.get(c)) {
if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))
cuv = true,total++;
else {
if (cuv == true) {
cuvinte++;
cuv = false;
}
}
}
fout << total/cuvinte;
fin.close();
fout.close();
return 0;
}