Pagini recente » Cod sursa (job #2563107) | Cod sursa (job #2175859) | Cod sursa (job #380487) | Cod sursa (job #194415) | Cod sursa (job #215429)
Cod sursa(job #215429)
#include<fstream.h>
long l,nr;
int sw;
char c;
int main()
{
ifstream fin("text.in");
nr=0; sw=1;
while(!fin.eof())
{c=fin.get();
if((c>='a'&&c<='z')||(c>='A'&&c<='Z'))
{l++;
if(sw==1)
{nr++; sw=0;}
}
else
sw=1;
}
fin.close();
if((c>='a'&&c<='z')||(c>='A'&&c<='Z'))
l--;
ofstream fout("text.out");
fout<<l/nr<<'\n';
fout.close();
return 0;
}