Cod sursa(job #974822)

Utilizator alex_bucevschiBucevschi Alexandru alex_bucevschi Data 18 iulie 2013 13:41:23
Problema Text Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.41 kb
#include <fstream>

using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int main()
{
    char x;
    int lit=0,cuv=0,ok=0;
    while(fin.get(x))
    {
        if(!isalpha(x)&&ok==1)
        {
            cuv++;
            ok=0;
        }
        else
            if(isalpha(x))
            {
                lit++;
                ok=1;
            }
    }
    return 0;
}