Pagini recente » Cod sursa (job #2856629) | Cod sursa (job #1340171) | Cod sursa (job #1104039) | Cod sursa (job #949973) | Cod sursa (job #277006)
Cod sursa(job #277006)
#include<fstream.h>
#include<string.h>
#include<ctype.h>
char x[64001];
int n,ok,c,i,m;
int main()
{
ifstream f("text.in");
ofstream g("text.out");
m=0;
while(f.getline(x,64000))
{
i=0;
n=strlen(x);
while(i<n)
{
ok=0;
while(isalpha(x[i]))
{
m++;
i++;
ok=1;
}
if(ok)
c++;
i++;
}
}
if(c==0)
g<<m;
else
g<<m/c;
f.close();
g.close();
return 0;
}