Pagini recente » Cod sursa (job #1472727) | Cod sursa (job #2434803) | Cod sursa (job #2601830) | Cod sursa (job #3264099) | Cod sursa (job #2630339)
#include <iostream>
#include <fstream>
#include <cstring>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int main()
{
string text;
getline(fin, text);
int i=0,s=0,nr=0;
bool first=true;
while(i<text.length())
{
if((text[i] >= 'a' && text[i] <= 'z') ||(text[i] >= 'A' && text[i] <= 'Z'))
{
s++;
if(first == true)
{
nr++;
first = false;
}
}
else
{
first = true;
}
i++;
}
fout<<s/nr;
return 0;
}