Pagini recente » Cod sursa (job #817140) | Cod sursa (job #955039) | Cod sursa (job #701619) | Cod sursa (job #1618240) | Cod sursa (job #260834)
Cod sursa(job #260834)
// Text.cpp : Defines the entry point for the console application.
//
#include <stdio.h>
#include <stdlib.h>
char e[2000004];
int main()
{
int n,i,c=0,d=0;
bool s=false,a;
FILE *f1,*f2;
f1=fopen("text.in","r");
f2=fopen("text.out","w");
fgets(e,2000003,f1);
for(i=1;i<=2000003;i++)
{
a=s;
s=false;
if(e[i]<=90)
if(e[i]>=65)
{
c++;
s=true;
}
if(e[i]>=97)
if(e[i]<=122)
{
c++;
s=true;
}
if(s==false && a==true)
d++;
if(e[i]=='EOF')
break;
}
fprintf(f2,"%d",c/d);
fclose(f1);
fclose(f2);
return 0;
}