Cod sursa(job #2009912)

Utilizator DianaPopDiana Pop DianaPop Data 11 august 2017 11:01:53
Problema Text Scor 100
Compilator c Status done
Runda Arhiva de probleme Marime 0.56 kb
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(){

    FILE *fin = fopen( "text.in" , "r");
    FILE *fout = fopen( "text.out" , "w");

    char ch;
    int len,cuv,k=0,sol;

    while (fscanf( fin ,"%c" , &ch) != EOF ){

        if( strchr( "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", ch ) != NULL ){
            len++;
            if( k == 0)
                cuv++;
            k = 1;
        }else{
            k = 0;
        }

    }
     sol = len/cuv;

    fprintf( fout , "%d" , sol );


    return 0;
}