Cod sursa(job #1609099)

Utilizator CodrinsahCotarlan Codrin Codrinsah Data 22 februarie 2016 16:56:53
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.45 kb
#include <fstream>
using namespace std;
ifstream fi ("text.in");
ofstream fo ("text.out");
char c;
int l,k,longg,cuv;
int main()
{
  k=1;
    while (fi.get(c))
    {
      if ((c>=65 and c<=90) or (c>=97 and c<=122))
      {
        l++;
        k=0;
      }
      else
      {
        longg+=l;
        l=0;
        if (k==0)
        {
          k=1;
          cuv++;
        }
      }
    }
    fo<<longg/cuv;
    return 0;
}