Pagini recente » Cod sursa (job #1940578) | Cod sursa (job #1944483) | Cod sursa (job #1654641) | Cod sursa (job #626424) | Cod sursa (job #1361123)
#include <fstream>
#include <string.h>
using namespace std;
ifstream in ("text.in");
ofstream out ("text.out");
string text;long long lungime,nr_cuvinte,aux;
int main()
{
for (int i=0;i<text.length();i++)
{
if (i>0)
if (((text[i-1]>=65&&text[i-1]<=90)||(text[i-1]>=97&&text[i-1]<=122))&&(text[i]<65||(text[i]>90&&text[i]<97)||text[i]>122))
nr_cuvinte++;
else if ((text[i]>=65&&text[i]<=90)||(text[i]>=97&&text[i]<=122))
lungime++;
}
out<<lungime/nr_cuvinte;
return 0;
}