Pagini recente » Cod sursa (job #1339962) | Cod sursa (job #2611880) | Cod sursa (job #357819) | Cod sursa (job #1359250) | Cod sursa (job #1780602)
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int main()
{
int L=0,NR=0;
char prec;
char act;
fin>>prec;
if(isalpha(prec))
L++;
while(fin.get(act))
{
if(isalpha(prec)==0 && isalpha(act)==1)
{NR++;L++;}
if(isalpha(prec)==1 && isalpha(act)==1)
L++;
prec=act;
}
fout<<L/NR;
return 0;
}