Cod sursa(job #946554)
| Utilizator | Data | 4 mai 2013 19:39:00 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.5 kb |
#include <fstream>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
char s;
int lg, cuv;
int main()
{
bool ok = false;
while (fin.get(s))
{
while ((s >= 'a' && s <= 'z') || (s >= 'A' && s <= 'Z'))
{
++lg;
ok = true;
fin.get(s);
}
if (ok == true)
{
++cuv;
ok = false;
}
}
fout << lg / cuv;
fin.close();
fout.close();
}
