Cod sursa(job #744039)
Utilizator | Data | 7 mai 2012 00:56:36 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.59 kb |
#include<fstream>
using namespace std;
int main(void)
{
ifstream in;
ofstream of;
in.open("text.in");
of.open("text.out");
int cuvinte = 0, caractere = 0;
bool ok=false;
while (in.good())
{
char caracter;
in.get(caracter);
if (isalpha(caracter))
{
++caractere;
ok = true;
}
else
if (ok)
{
ok = false;
++cuvinte;
}
}
of << caractere / cuvinte;
return 0;
}