Cod sursa(job #225743)

Utilizator raica_cristiraica dumitru cristian raica_cristi Data 30 noiembrie 2008 20:10:42
Problema Text Scor 40
Compilator cpp Status done
Runda Arhiva de probleme Marime 1.16 kb
#include<fstream>
#include<string.h>

using namespace std;

ifstream fin ("text.in");
ofstream fout ("text.out");

char a[52]={'q','w','e','r','t','y','u','i','o','p','a','s','d','f','g','h','j','k','l','z','x','c','v','b','n','m','Q','W','E','R','T','Y','U','I','O','P','A','S','D','F','G','H','J','K','L','Z','X','C','V','B','N','M'};

int main ()
{
    char x[250000];
    int n,i,k,cuv=0,lit=0,cuv2=0;
    fin.getline(x,250000);
    n=i=k=0;
    k=strlen(x);
    for(i=0;i<=k;i++)
    {//if(strchr(a,x[i-1])==0 && strchr(a,x[i])!=0)
  //  cuv2++;
                //fout<<(int)x<<" ";
                  if(strchr(a,x[i])==0)
                  n=0;
                  else
                  {//fout<<"1 ";
                                    if(n==0)
                                 {   cuv++;
                              //   fout<<"2 \n";
                              }
                                    n=1;
                                    lit++;
                                    }
                                       
                  }
                  fout<<(lit-1)/(cuv-1);
                  return 0;
                  }