Cod sursa(job #1409099)

Utilizator akaprosAna Kapros akapros Data 30 martie 2015 13:26:32
Problema Text Scor 40
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.57 kb
#include<cstdio>
#include<algorithm>
#include<cstring>
#define Nmax 10000005
int n,i,l,nrc;
char s,ch;
int main()
{
    freopen("text.in","r",stdin);
    freopen("text.out","w",stdout);
    while (scanf("%c",&s))
    {
        if (s=='\n') break;
        if ((s>'Z' || s<'A') && (s<'a' || s>'z'))
        if ((ch<='Z' && ch>='A') || ( ch<='z' && ch>='a' ))
        nrc++;
        if ((s<='Z' && s>='A') || ( s<='z' && s>='a' )) l++;
        ch=s;
    }
    if ((ch<='Z' && ch>='A') || ( ch<='z' && ch>='a' )) nrc++;
    printf("%d",l/nrc);
    return 0;
}