Cod sursa(job #1190015)

Utilizator hasmasandragosHasmasan Dragos hasmasandragos Data 24 mai 2014 12:00:43
Problema Text Scor 40
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.47 kb
#include <fstream>
#include <cstring>
#define Nmax 1000005
using namespace std;

ifstream f("text.in");
ofstream g("text.out");

char a[Nmax];
int lg,cont,lit,i;

int main()
{f.getline(a,Nmax);
 lg=strlen(a);
 for (i=0;i<lg;i++)
 { if ((a[i]>='a' && a[i]<='z') || (a[i]>='A' && a[i]<='Z'))
   {cont++;
    while ((a[i]>='a' && a[i]<='z') || (a[i]>='A' && a[i]<='Z'))
     {lit++; i++;};
   }
 }
 g<<lit/cont<<'\n';
 f.close();
 g.close();
    return 0;
}