Cod sursa(job #186267)

Utilizator firewizardLucian Dobre firewizard Data 27 aprilie 2008 03:44:03
Problema Text Scor 40
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.51 kb
#include <stdio.h>
#include <string> 
#define cuv(c) (((c) >= 'a' && (c) <= 'z') || ((c) >= 'A' && (c) <= 'Z')) 
char c[2048*1024]; 
int main() 
{ 
    int n, nc = 0, nl = 0, i; 
    freopen("text.in","r",stdin);
    freopen("text.out", "w", stdout);
    fgets(c,sizeof(c),stdin);
    n=strlen(c)-1;
    c[n]=' '; 
    for (i = 0; i < n; i++){ 
        if (cuv(c[i])){ 
           nl++; 
           if(!cuv(c[i+1]))nc++; 
           } 
        } 
     
    printf("%d\n", nl/nc); 
    return 0; 
}