Pagini recente » Cod sursa (job #720045) | Cod sursa (job #878514) | Cod sursa (job #2514943) | Cod sursa (job #1609077) | Cod sursa (job #308580)
Cod sursa(job #308580)
#include<stdio.h>
#include<string.h>
using namespace std;
FILE *f,*s;
char a,b,sep[200]="_ 1234567890,.?/!;\'-@#$%^&*(){}[]|:<>+~`\n\0",lit[200]="aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ",*c1,*c2,*c3;
long long int nrc,nrl;
int main()
{
f=fopen("text.in","r");
s=fopen("text.out","w");
while(!feof(f))
{
fscanf(f,"%c",&a);
c1=strchr(sep,a);
c2=strchr(sep,b);
c3=strchr(lit,a);
if(c1!=NULL&&c2==NULL)
nrc++;
if(c3!=NULL)
nrl++;
b=a;
}
fprintf(s,"%lld",nrl/nrc);
fclose(s);
return 0;
}