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