Pagini recente » Cod sursa (job #479129) | Cod sursa (job #485501) | Cod sursa (job #976288) | Cod sursa (job #2310558) | Cod sursa (job #260817)
Cod sursa(job #260817)
// 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,1000003,f1);
for(i=1;i<=100003;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]==0)
break;
}
fprintf(f2,"%d",c/d);
fclose(f1);
fclose(f2);
return 0;
}