Cod sursa(job #1662465)
Utilizator | Data | 24 martie 2016 19:39:09 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.52 kb |
#include <fstream>
#include <cstring>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int nr_cuvinte,lungime;
char a;
void rezolvare()
{
int contor=0,i=0;
while(fin.get(a))
{
if(isalpha(a))
{
if(contor==0)
nr_cuvinte++;
contor++;
lungime++;
}
else
contor=0;
i++;
}
}
int main()
{
rezolvare();
fout<<lungime/nr_cuvinte;
return 0;
}