Pagini recente » Cod sursa (job #358071) | Cod sursa (job #720303) | Cod sursa (job #2954545) | Cod sursa (job #1489777) | Cod sursa (job #1130449)
#include<stdio.h>
#include<string.h>
using namespace std;
int i,nrlitere,nrcuv,z;
char text[99999999];
char alfabet[53] = "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM";
int main()
{
freopen("text.in","r",stdin);
freopen("text.out","w",stdout);
gets(text);
for(i=0;i<strlen(text);i++)
{
if(strchr(alfabet,text[i])) nrlitere++;
}
for(i=0;i<strlen(text);i++)
{
if(strchr(alfabet,text[i]))
{
z=i; i=strlen(text);
}
}
strcpy(text,strchr(text,text[z]));
for(i=0;i<strlen(text);i++)
{
if(!strchr(alfabet,text[i]))
{
nrcuv++;
}
}
nrcuv--; nrcuv=nrlitere/nrcuv;
printf("%d",nrcuv);
return 0;
}