Cod sursa(job #792428)

Utilizator viktor.istratiVictor Istrati viktor.istrati Data 27 septembrie 2012 10:41:04
Problema Text Scor 0
Compilator cpp Status done
Runda asem-etapa1 Marime 0.58 kb
#include <stdio.h>
using namespace std;  
int main()
{   
    freopen("text.in","r",stdin);
    freopen("text.out","w",stdout);  
    char c,tmp = 0;int litera=0,cuvant=0;
    
    
    while(!feof(stdin))
    {    
         
         c=fgetc(stdin);
         if((c>='a' && c<='z') || (c>='A' && c<= 'Z'))
         {
                    litera++;
                    tmp=1;
         } 
         else { if (tmp == 1) cuv++;
                tmp = 0;
              }
         
    }
    fclose(stdin);
    printf("%d",litera/cuvcuvant);
    fclose(stdout); 
    return 0;
}