Pagini recente » Cod sursa (job #3213770) | Cod sursa (job #2824156) | Cod sursa (job #2824747) | Cod sursa (job #3130987) | Cod sursa (job #1729898)
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
string line;
int islitera(int i)
{
if(i<0)
{
return false;
}
if(('a'<=line[i] && line[i]<='z') || ('A'<=line[i] && line[i]<='Z'))
{
return true;
}
return false;
}
int main()
{
int c, l, d;
c=0;
l=0;
getline (fin,line);
for(int i=0; i<line.size(); i++)
{
if(islitera(i)==false)
{
if(islitera(i-1)==true)
{
c++;
}
}
if(islitera(i)==true)
{
l++;
}
}
if(islitera(line.size()-1) == true)
{
c++;
}
if(c!=0)
{
d=l/c;
}
else
{
d=0;
}
fout<<d<<'\n';
return 0;
}