Cod sursa(job #74376)

Utilizator mircea_infoSuciu Mircea-Gabriel mircea_info Data 25 iulie 2007 12:13:06
Problema Text Scor 90
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.54 kb
#include<stdio.h>
#include<string.h>
#include<ctype.h>
char c; int nr=0,k=0;
void rezolvare(){
  freopen("text.in","r",stdin);
  freopen("text.out","w",stdout);
  c=getc(stdin);
  while(!isalpha(c)&&!feof(stdin))
    c=getc(stdin);
  while(!feof(stdin)){
    if(isalpha(c)){
      k++;
      c=getc(stdin);
    }
    else{
      while(!isalpha(c)&&!feof(stdin))
	c=getc(stdin);
      nr++;
    }
  }
  if(k!=0)
    printf("%d",k/nr);
  else
    printf("0");
  fclose(stdout);
}
int main(){
  rezolvare();
  return 0;
}