Cod sursa(job #1957671)
Utilizator | Data | 7 aprilie 2017 18:18:08 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.38 kb |
#include <fstream>
#include <string.h>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int main()
{ char a;
int nr_lit=0,cuv=0,ok=0;
do{
a = f.get();
if(isalpha(a))
{++nr_lit;
if(!ok) {++cuv;++ok;}
}
else ok = 0;
}while(!f.eof());
g<<nr_lit/cuv;
f.close();
g.close();
return 0;
}