Cod sursa(job #2269821)
Utilizator | Data | 26 octombrie 2018 17:18:03 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.35 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream in("text.in");
ofstream out("text.out");
int no, words;
char c;
int main()
{
while (in.get(c)) {
if (isalpha(c)) {
words++;
while (isalpha(c)) {
no++;
in.get(c);
}
}
}
out << no / words << '\n';
in.close();
out.close();
return 0;
}