Cod sursa(job #806947)

Utilizator exclamatieDica Florin Sebastian exclamatie Data 3 noiembrie 2012 19:26:52
Problema Text Scor 40
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.47 kb
#include <iostream>
#include <fstream>
#include <string.h>
using namespace std;
int main()
{
    ifstream fin("text.in");
    ofstream fout("text.out");
    char a[5000],b;
    int i,x=0,y=0;
    fin.get(a,5000);
    b=' ';
    for(i=0;i<strlen(a);i++)
    {
        if(((65<=a[i])&&(a[i]<=90))||((97<=a[i])&&(a[i]<=122)))x++;
        else
        {
        if(((65<=b)&&(b<=90))||((97<=b)&&(b<=122))) y++;
        }
        b=a[i];
    }
    fout<<x/y;
}