Cod sursa(job #1416032)

Utilizator dani16Apopei Daniel dani16 Data 7 aprilie 2015 09:08:12
Problema Text Scor 30
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.45 kb
#include <fstream>
#include <cstring>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char s[256];
int nrl,nrc,i,ok;
int main()
{
    f.get(s,256);
    for(i=1;i<=strlen(s);i++)
    {
        if(s[i]<='Z'&&s[i]>='A'||s[i]<='z'&&s[i]>='a')
        {
            nrl++;
            ok=1;
        }
        if((s[i]==' '||s[i]=='-')&&ok)
            nrc++;
    }
    nrc++;
    g<<nrl/nrc;
    g.close();
    return 0;
}