Cod sursa(job #1123516)

Utilizator AlexxanderXPrisacariu Alexandru AlexxanderX Data 26 februarie 2014 08:53:23
Problema Text Scor 30
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.59 kb
#include <fstream>

#define DEBUG 0
#if DEBUG
    #include <iostream>
#endif

using namespace std;

int main()
{
    ifstream in("text.in");
    ofstream out("text.out");

    int l = 0, c = 0;
    char t;
    bool swL = false;

    while (in.get(t))
    {
        #if DEBUG
            cout << "t(" << t << ") ";
        #endif
        if ((t>='a'&&t<='z')||(t>='A'&&t<='Z'))
        {
            ++l;
        }
        else
        {
            ++c;
        }
    }

    --c;

    #if DEBUG
        cout << l/c;
    #endif
    out << l/c;

    return 0;
}