Cod sursa(job #2409575)
| Utilizator | Data | 19 aprilie 2019 11:16:39 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.52 kb |
#include <fstream>
#include <iostream>
#include <sstream>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
inline bool litera(char c) {
return ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'));
}
int main() {
int k = 0, len = 0, cuv = 0;
char c;
while (fin >> noskipws >> c) {
if (litera(c)) {
len++;
if (k == 0)
cuv++;
k = 1;
} else
k = 0;
}
int sol = len / cuv;
fout << sol;
fin.close();
fout.close();
return 0;
}
