Pagini recente » Cod sursa (job #900242) | Cod sursa (job #1193381) | Cod sursa (job #39089) | Cod sursa (job #2900104) | Cod sursa (job #260791)
Cod sursa(job #260791)
// Text.cpp : Defines the entry point for the console application.
//
#include <stdio.h>
#include <stdlib.h>
char e[2000004];
bool b[2000004];
int main()
{
int n,i,c=0,d=0;
FILE *f1,*f2;
f1=fopen("text.in","r");
f2=fopen("text.out","w");
fgets(e,1000003,f1);
for(i=1;i<=100003;i++)
{
if(e[i]<=90)
if(e[i]>=65)
{
c++;
b[i]=true;
}
if(e[i]>=97)
if(e[i]<=122)
{
c++;
b[i]=true;
}
if(e[i]>122 || e[i]<65)
if(b[i-1]==true)
d++;
if(e[i]>90 && e[i]<97)
if(b[i-1]==true)
d++;
}
fprintf(f2,"%d",c/d);
fclose(f1);
fclose(f2);
return 0;
}