Cod sursa(job #1231971)

Utilizator AcuasPopescu Nicolae-Aurelian Acuas Data 21 septembrie 2014 19:56:40
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.43 kb
#include <cstdio>
#include <cstring>
#include <cctype>
using namespace std;
char x;
int s,k,t,q,ok;
int main()
{
    freopen("text.in","r",stdin);
    freopen("text.out","w",stdout);
    while(scanf("%c",&x)!=EOF)
        if(x>='a'&&x<='z'||x>='A'&&x<='Z')
         {
            k++;
            if(ok==0)
                q++;
            ok=1;
         }
         else ok=0;
    printf("%d",k/q);
    return 0;
}