Cod sursa(job #890042)

Utilizator raulmuresanRaul Muresan raulmuresan Data 24 februarie 2013 20:22:36
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.65 kb
#include <cstdio>
#include <cstring>
#include <cctype>

using namespace std;
int i,aux,n,b,k,j,p,m,s,pas,l,cuv,litere,ok,medie;
char c;

int main()
{
    freopen ("text.in","r",stdin);
    freopen ("text.out","w",stdout);

   // gets(text);
    //printf("%s\n",text);
   // pas=0;
    //l=strlen(text);

    //printf("%d",pas);
   while(scanf("%c",&c)==1)
    {
        if(((c>='a')&&(c<='z'))||((c>='A')&&(c<='Z')))
        {
            litere++;
            ok=1;
        }
        else if(ok==1)
        {
            cuv++;
            ++i;
            ok=0;
        }
    }
    medie=litere/cuv;
    printf("%d\n",medie);

}