Cod sursa(job #1465855)

Utilizator zertixMaradin Octavian zertix Data 28 iulie 2015 09:15:18
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.51 kb
#include <cstdio>
#include <cstring>
#include <ctype.h>
#include <iostream>
using namespace std;
char crt,ant;
int main()
{
    freopen("text.in","r",stdin);
    freopen("text.out","w",stdout);
    int i=0,k=0,k1=0;
    scanf("%c",&crt);
    if (isalpha(crt))
        ++k;
    while(!feof(stdin))
    {
        ant=crt;
        scanf("%c",&crt);
        if (isalpha(crt))
                ++k;
            else if (isalpha(ant))
                ++k1;
    }
    printf("%d",k/k1);
    return 0;
}