Cod sursa(job #1990777)

Utilizator razvanboabesrazvan boabes razvanboabes Data 13 iunie 2017 15:50:10
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.57 kb
#include <fstream>
using namespace std;
ifstream in ("text.in");
ofstream out ("text.out");

int main()
{
   char x,vec;
   int cnt=0,nrc=0;
   bool cuv=0;
   vec=in.get();
   if((vec>=65 and vec<=90) ||(vec>=97 and vec<=122))
   {
        cnt++;
        cuv=1;
   }
   while(!in.eof())
   {
     x=in.get();
        if((x>=65 and x<=90) ||(x>=97 and x<=122))
        { cnt++;
            cuv=1;
        }

       else
            if(cuv==1)
        {
            cuv=0;
            nrc++;
        }      vec=x;
   }
   out<<cnt/nrc;
    return 0;
}