Cod sursa(job #1133627)
Utilizator | Data | 5 martie 2014 10:47:25 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.37 kb |
#include <fstream>
using namespace std;
char c;
int l, cuvinte;
bool cuvant;
int main () {
ifstream fi("text.in");
ofstream fo("text.out");
while (fi.get(c)) {
if ((('a' <= c) and (c <= 'z')) or (('A' <= c) and (c <= 'Z')))
l++, cuvant = true;
else
if (cuvant)
cuvant = false, cuvinte++;
}
fo << l/cuvinte;
return 0;
}