Mai intai trebuie sa te autentifici.

Cod sursa(job #766949)

Utilizator PopdanDanielPopdan Daniel PopdanDaniel Data 12 iulie 2012 15:10:43
Problema Text Scor 100
Compilator c Status done
Runda Arhiva de probleme Marime 0.45 kb
#include <stdio.h>
#include <stdlib.h>
int main()
{
    int a,k=0,t=0,s=0;
    FILE *fin,*fout;
    fin=fopen("text.in", "r");
    fout=fopen("text.out", "w");
    while((a=fgetc(fin))!=EOF)
    {
        if(/*(a>47)&&(a<58))||*/((a>64)&&(a<91))||((a>96)&&(a<123)))
            {
            if(s==0)
            t++;
            k++;
            s=1;
            }
        else
        s=0;
    }
    fprintf(fout,"%d",k/t);
    return 0;
}