Cod sursa(job #2722465)
Utilizator | Data | 12 martie 2021 21:06:33 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.4 kb |
#include <fstream>
using namespace std;
int nr_cuv, nr_litere;
void read() {
char ch;
ifstream f("text.in");
while (f.get(ch))
if (isalpha(ch)) {
nr_cuv++;
nr_litere++;
while (isalpha(f.peek())) {
f.get(ch);
nr_litere++;
}
}
}
void output() {
ofstream g("text.out");
g << nr_litere / nr_cuv;
g.close();
}
int main() {
read();
output();
return 0;
}