Pagini recente » Cod sursa (job #421396) | Cod sursa (job #1727998) | Cod sursa (job #445123) | Cod sursa (job #3198717) | Cod sursa (job #1576394)
#include <iostream>
#include <fstream>
using namespace std;
string s;
int w,l,n,i,k=0,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++;
else if ((((s[i]>=65) and (s[i]<=90)) or ((s[i]>=97) and (s[i]<=122)))
or (((s[i+1]>=65) and (s[i+1]<=90)) or ((s[i+1]>=97) and (s[i+1]<=122)))) c++;
}
c++;
if (!(((s[n-1]>=65) and (s[n-1]<=90)) or ((s[n-1]>=97) and (s[n-1]<=122)))) c--;
else c--;
g<<l/c;
return 0;
}