Cod sursa(job #1130449)

Utilizator Andrei11Andrei Andrei11 Data 28 februarie 2014 13:19:28
Problema Text Scor 20
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.76 kb
#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;
}