Cod sursa(job #310134)

Utilizator cosgbCosmin cosgb Data 1 mai 2009 20:46:04
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.49 kb
#include <stdio.h>
#include <ctype.h>
char c[1048578];//1048578
int main()
{ freopen ("text.in","r",stdin);
  freopen ("text.out","w",stdout);
  long nrlit=0,nrcuv=0,nr,i,j;
  char d;
  i=0;
  while (scanf ("%c",&d)!=EOF)
   c[i++]=d;
   i--;
  for (j=0;j<=i;j++)
  { if (isalpha(c[j])!=0)
      {if(isalpha (c[j+1])!=0)
		    nrlit++;
	     else
	     {nrlit++;
	      nrcuv++;
	     }
      }
  }
  nr=nrlit/nrcuv;
  printf ("%ld",nr);
  fcloseall();
  return 0;
  }