Cod sursa(job #1465556)

Utilizator Wh1plashOvidiu Taralesca Wh1plash Data 27 iulie 2015 16:50:39
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.49 kb
#include <fstream>
#include <cstring>
using namespace std;
int nr=0,lg=0;
char s,x;
ifstream f("text.in");
ofstream g("text.out");
bool lt(char x)
{
    if((x>='a' && x<='z')||(x>='A'&&x<='Z'))
        return true;
    else return false;
}
int main()
{
    while(f>>noskipws>>s)
    {
        if(lt(s)==1) lg++;
        if(x!=0)
            if(lt(s)==0)
                if(lt(x)==1)
                    nr++;

        x=s;
    }
    g<<lg/nr;
    //cout<<lg;
    return 0;
}