Pagini recente » Cod sursa (job #1142879) | Cod sursa (job #2947778) | Cod sursa (job #2895368) | Cod sursa (job #749250) | Cod sursa (job #1570236)
#include <iostream>
#include <fstream>
using namespace std;
string s;
int w,l,n,i,k=0;
float c;
int main()
{
ifstream f("text.in");
ofstream g("text.out");
getline (f,s);
n=s.length();
for (i=0;i<=n-1;i++)
{
if (((s[i]>=65) and (s[i]<=90)) or ((s[i]>=97) and (s[i]<=122))) {l++;k=1;}
else if ((k==1) and ((s[i]==' ') or (s[i]=='-'))) {w++;k=0;}
}
w++;
c=l/w;
g<<c;
return 0;
}