Cod sursa(job #346610)
| Utilizator | Data | 8 septembrie 2009 18:47:46 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.43 kb |
#include <iostream>
#include <fstream>
using namespace std;
int main() {
int nrc = 0, l = 0, ok = 0;
char c;
ifstream fin("text.in");
ofstream fout("text.out");
while (!fin.eof()) {
c = fin.get();
if ( (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') ) {
ok = 1;
l++;
}
else {
if (ok) nrc++;
ok = 0;
}
}
fout << (int) (l / nrc) << "\n";
fin.close();
fout.close();
return 0;
}