Pagini recente » Cod sursa (job #1857126) | Cod sursa (job #324448) | Cod sursa (job #1423600) | Cod sursa (job #2147338) | Cod sursa (job #1045285)
#include <string.h>
#include <stdio.h>
using namespace std;
FILE *f=fopen("text.in","r");
FILE *g=fopen("text.out","w");
char s[15000] ;
int main()
{
int i=0,lungt=0,nrcuv=0;
char x;
while(fscanf(f,"%c",&x)&& x!='\n')
{
s[i]=x;
if((s[i]>='a'&& s[i]<='z' )||(s[i]>='A' && s[i]<='Z'))
lungt++;
else
{
if(i)
if(strchr("qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM",s[i-1]))
nrcuv++;
}
i++;
}
if(strchr("qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM",s[i-1]))
nrcuv++;
fprintf(g,"%d",lungt/nrcuv);
return 0;
}