Cod sursa(job #1607305)
Utilizator | Data | 20 februarie 2016 23:21:06 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.46 kb |
# include <fstream>
# define verif(a) ((a>='a'&&a<='z')||(a>='A'&&a<='Z'))
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
char c;
int w, l;
bool s;
int main() {
while (fin.get(c)) {
if (verif(c)) {
++l;
s = true; /// am avut gasit o litera, deci un cuvant
} else if (s) {
++w;
s = false;
}
}
fout << (l/w);
return 0;
}