Pagini recente » Cod sursa (job #2775939) | Cod sursa (job #3285434) | Cod sursa (job #2577189) | Cod sursa (job #630716) | Cod sursa (job #1131557)
#include<cstdio>
#include<cstring>
#define InFile "text.in"
#define OutFile "text.out"
using namespace std;
unsigned long long lit,cuv;
char k;
bool ok;
int main()
{
FILE *f=fopen(InFile,"r");
FILE *g=fopen(OutFile ,"w");
while(fscanf(f,"%c",&k)!=EOF)
{
while(k>='a'&&k<='z'||k>='A'&&k<='Z')
{
lit++;ok=true;
fscanf(f,"%c",&k);
}
if(ok)cuv++,ok=false;
}
if(!lit||!cuv)fprintf(g,"0");else
fprintf(g,"%d",lit/cuv);
return 0;
}