Pagini recente » Statisticile problemei Babacu | Cod sursa (job #3292670) | Rating Constantin Cristian (stifmeister) | Cod sursa (job #3188250) | Cod sursa (job #943594)
Cod sursa(job #943594)
#include<stdio.h>
using namespace std;
char c;long int litere,cuvinte;bool sw;
int main()
{
FILE*fin=fopen("text.in","r");
while(fscanf(fin,"%c",&c)!=EOF)
{
if(((c>='a')&&(c<='z'))||((c>='A')&&(c<='Z')))
{
litere++;sw=1;
}
else if(sw==1){cuvinte++;sw=0;}
}
fclose(fin);
FILE*fout=fopen("text.out","w");
fprintf(fout,"%d",litere/cuvinte);
fclose(fout);
return 0;
}