Cod sursa(job #2230589)
Utilizator | Data | 10 august 2018 17:56:25 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | 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;
}