Cod sursa(job #565593)

Utilizator bogfodorBogdan Fodor bogfodor Data 27 martie 2011 22:37:06
Problema Text Scor 90
Compilator cpp Status done
Runda gr_4 Marime 0.46 kb
#include <cstdio>
#include <cstring>
#include <cctype>

using namespace std;

FILE *fin=freopen("text.in","r",stdin);
FILE *fout=freopen("text.out","w",stdout);

int main()
{
    char s,p;
    int nrc=0,l=0;
    scanf("%c",&p);
    while(!feof(stdin))
    {
        scanf("%c",&s);
        if(isalpha(p)){
                l++;
        if(!isalpha(s))
                nrc++;
        }
        p=s;
    }
    printf("%d",l/nrc);
    return 0;
}