Cod sursa(job #1540708)

Utilizator stefan_gheorgheGheorghe Stefan stefan_gheorghe Data 3 decembrie 2015 08:53:19
Problema Text Scor 40
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.39 kb
#include <cstring>
#include <fstream>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char s[256],sep[8]="-!.,;: ",*p;
int nr,nc,i;
int main()
{
    f.getline(s,256);
    for (i=0;i<=strlen(s);i++) if (65<=s[i] && s[i]<=122)  nc++;
    p=strtok(s,sep);
    nr=0;
    while (p)
    {
        p=strtok(NULL,sep);
        nr++;
    }
    g<<nc/nr;
    return 0;
}