Pagini recente » Cod sursa (job #880815) | Cod sursa (job #233136) | Cod sursa (job #460831) | Cod sursa (job #1097116) | Cod sursa (job #11533)
Cod sursa(job #11533)
#include<fstream.h>
#include<string.h>
#define input "text.in"
#define output "text.out"
int main()
{
ifstream fin(input);
char a[100000];
char *b;
int s,n,i,ant=0;
b="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
s=0;
while( !fin.eof() )
{
fin.getline(a,100000);
for(i=0;i<strlen(a);i++)
{
if(strchr(b,a[i]))
{
n++;
ant=1;
}
else
if(ant)
{
s++;
ant=0;
}
}
}
ofstream fout(output);
fout<<n/s;
return 0;
}