Cod sursa(job #790640)

Utilizator DOru1995DorU FlorIN DOru1995 Data 21 septembrie 2012 23:21:44
Problema Text Scor 20
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.81 kb
#include <iostream>
#include <fstream>
#include <string.h>
using namespace std;

char s[99999999];

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

void citire()
{
   in.get(s,99999999);
}

void count()
{
    long long int k=0,z=0;
    for(register long int i=0;i<strlen(s);i++)
         {
         if((int)s[i]>=65 and (int)s[i]<=90)
         {
             k++;
             if(s[i+1]=='-' or s[i+1]=='!' or s[i+1]==' ' or s[i+1]==',' or s[i+1]=='.'
                or s[i+1]==';' ) z++;
         }
         if((int)s[i]>=97 and (int)s[i]<=122)
         {
             k++;
             if(s[i+1]=='-' or s[i+1]=='!' or s[i+1]==' ' or s[i+1]==',' or s[i+1]=='.'
                or s[i+1]==';' ) z++;
         }
         }
      out<<k/z;
}

int main()
{
    citire();
    count();
}