Pagini recente » curcani | Cod sursa (job #763476) | Cod sursa (job #3230883) | Cod sursa (job #975758) | Cod sursa (job #1361406)
#include <fstream>
#include <iostream>
#include <string.h>
using namespace std;
ifstream in ("text.in");
ofstream out ("text.out");
char text;
bool cuvant=false;
int lungime,nr_cuvinte;
int main()
{
while (!in.eof())
{
in>>noskipws>>text;
if ((text>='a'&&text<='z')||(text>='A'&&text<='Z'))
{
lungime++;
if (cuvant==false)
{
nr_cuvinte++;
cuvant=true;
}
}
else cuvant = false;
}
out<<lungime/nr_cuvinte;
return 0;
}