Cod sursa(job #1322927)

Utilizator sorina.andreiAndrei Sorina sorina.andrei Data 20 ianuarie 2015 15:30:52
Problema Text Scor 70
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.66 kb
#include<string.h>
#include <stdio.h>
using namespace std;
long long lit,cuv;
bool b;
int main()
{
    FILE *fin,*fout;
    fin=fopen("text.in","r");
    fout=fopen("text.out","w");
    char c[1000005];
    while(!feof(fin))
    {
    fread(c,1,1000000,fin);
    for(int i=0;i<strlen(c);++i)
    {
               
            if((c[i]>='a'&&c[i]<='z')||(c[i]>='A'&&c[i]<='Z'))
            {
                lit++;
                b=1;
                
            }
            else    if(b==1)
            {
                       cuv++; 
                       b=0;
            }
                   
    }
}
  fprintf(fout,"%lld",lit/cuv);

}