Cod sursa(job #1599418)

Utilizator ArminaMoldovanMoldovan Armina ArminaMoldovan Data 13 februarie 2016 20:54:26
Problema Text Scor 40
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.5 kb
#include<fstream>
#include<string.h>
using namespace std;

ifstream fin("text.in");
ofstream fout("text.out");

int main()
{
    char s[2000000], sep[]=" ,!?\n;.:'-/*#$%&()+=><| ";
    int  nrc=0,  i=0, k=0, q;
     fin.get(s,2000000);
     q=strlen(s);

    while(i<q)
    {
        if(s[i]>=65 && s[i]<=122)   nrc++;
        i++;
    }
    char *p=strtok (s, sep);
     while (p)
        {
           k++;
          p=strtok(NULL,sep);
        }
    if(k)   fout<<int(nrc/k);
}