Cod sursa(job #1164744)
| Utilizator | Data | 2 aprilie 2014 11:58:31 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.43 kb |
#include<fstream>
#include<cctype>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int cuvinte=0,lungime=0;
char caracter;
bool ok;
int main()
{
f.get(caracter);
ok=false;
while (!f.fail())
{
if (isalpha(caracter)) {ok=true;lungime++;}
else if (ok) {cuvinte++;ok=false;}
f.get(caracter);
}
g<<lungime/cuvinte;
f.close();g.close();
return 0;
}
