Pagini recente » Cod sursa (job #2416921) | Rating Schuller Claudiu (SchullerClaudiu) | Monitorul de evaluare | Rating Serban Doncean (serbandoncean) | Cod sursa (job #11572)
Cod sursa(job #11572)
#include<fstream.h>
#include<string.h>
#define input "text.in"
#define output "text.out"
int main()
{
ifstream fin(input);
char b;
int s,n,i,x,ant=0;
s=0;
while( !fin.eof() )
{
fin.get(b);
x=int(b);
if(x>=65&&x<=90||x>=97&&x<=122)
{
ant=1;
n++;
}
else
if(ant)
{
ant=0;
s++;
}
}
ofstream fout(output);
fout<<n/s;
return 0;
}