Cod sursa(job #1798242)

Utilizator AlexaCatanaCatana Alexandra-Vasilica AlexaCatana Data 4 noiembrie 2016 23:53:29
Problema Text Scor 0
Compilator c Status done
Runda Arhiva de probleme Marime 0.44 kb
#include <stdio.h>
#include <string.h>

int nr1=0,nr2=0,ok=0;
char c,litere[]="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPRSTUVWXYZ";

int main()
{
    freopen("text.in","r",stdin);
    freopen("text.out","w",stdout);

    while(scanf("%c",&c))
      if(strchr(litere,c)!=0)
      {
        ok=1;
        nr1++;
      }
      else
      {
          if(ok==1) nr2++;
          ok=0;
      }
  printf("%d",nr1/nr2);
  return 0;
  }