Cod sursa(job #791945)

Utilizator zdrobau_valeriuZdrobau Valeriu zdrobau_valeriu Data 25 septembrie 2012 20:09:00
Problema Text Scor 100
Compilator cpp Status done
Runda asem-etapa1 Marime 0.57 kb
#include <stdio.h>
using namespace std;  
int main()
{   
    freopen("text.in","r",stdin);
    freopen("text.out","w",stdout);  
    char c,tmp = 0;int lit=0,cuv=0;
    
    
    while(!feof(stdin))
    {    
         
         c=fgetc(stdin);
         if((c>='a' && c<='z') || (c>='A' && c<= 'Z'))
         {
                    lit++;
                    tmp=1;
         } 
         else { if (tmp == 1) cuv++;
                tmp = 0;
              }
         
    }
    fclose(stdin);
    printf("%d",lit/cuv);
    fclose(stdout); 
    return 0;
}