Pagini recente » Cod sursa (job #1608416) | Cod sursa (job #1441642) | Cod sursa (job #1062059) | Cod sursa (job #2686673) | Cod sursa (job #1131545)
#include<cstdio>
#include<cstring>
#define InFile "text.in"
#define OutFile "text.out"
using namespace std;
unsigned int lit,cuv;
char k;
bool ok;
int main()
{
FILE *f=fopen(InFile,"r");
FILE *g=fopen(OutFile ,"w");
while(fscanf(f,"%c",&k))
{
if(k=='\n')
{
fscanf(f,"%c",&k);
if(k=='\n')break;
}
while(k>='a'&&k<='z'||k>='A'&&k<='Z')
{
lit++;ok=true;
fscanf(f,"%c",&k);
}
if(ok)cuv++,ok=false;
}
fprintf(g,"%d",lit/cuv);
return 0;
}