Cod sursa(job #1033281)

Utilizator hevelebalazshevele balazs hevelebalazs Data 16 noiembrie 2013 18:00:14
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.47 kb
#include <stdio.h>
#include <string.h>
#define fr(i,a,b) for(int i=a;i<b;++i)
char c;
bool abc(){return ((c>='a'&&c<='z')||(c>='A'&&c<='Z'));};
int main(){
    freopen("text.in","r",stdin);
    freopen("text.out","w",stdout);
    int tot=0,w=0;
    bool in=false;
    while(!feof(stdin)){
        scanf("%c",&c);
        if(!in) {if(abc()) in=true,++w,++tot;}
        else if(abc()) ++tot;
        else in=false;
        }
    printf("%i",tot/w);
    return 0;
    }