Cod sursa(job #260719)

Utilizator dushmiMihai-Alexandru Dusmanu dushmi Data 17 februarie 2009 15:01:54
Problema Text Scor 30
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.75 kb
#include<stdio.h>
#include<string.h>
char a[15001];
long nrl,nrc,n,i;
int main()
{
    freopen("text.in","r",stdin);
    freopen("text.out","w",stdout);
    gets(a);
    n=strlen(a)-1;
    if( (a[0]>='A' && a[0]<='Z') || (a[0]>='a' && a[0]<='z') )
        nrl++;
    for(i=1;i<=n;i++)
                     if( (a[i]>='A' && a[i]<='Z') || (a[i]>='a' && a[i]<='z') )
                     {
                         nrl++;
                     }
                     else if( (a[i-1]>='A' && a[i-1]<='Z') || (a[i-1]>='a' && a[i-1]<='z') )
                     {
                          nrc++;
                     }
    if( (a[n]>='A' && a[n]<='Z') || (a[n]>='a' && a[n]<='z') )
        nrc++;
    printf("%ld",(long)nrl/nrc);
    return 0;
}