Pagini recente » Cod sursa (job #2531483) | Cod sursa (job #1532512) | Cod sursa (job #1040784) | Cod sursa (job #10949) | Cod sursa (job #1131552)
#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))
{
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;
}