Cod sursa(job #1219036)

Utilizator radudurlesteanuDurlesteanu Radu Stefan radudurlesteanu Data 13 august 2014 11:25:33
Problema Text Scor 100
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.45 kb
#include <fstream>
#include <string.h>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
char c1,c2;
long cuv,lung;
bool c1l,c2l;
int main()
{
while (!fin.eof())
   {
   c1=c2;c2=fin.get();c1l=false;c2l=false;
   if (((c2>=65) && (c2<=90)) || ((c2>=97) && (c2<=122))) c2l=true;
   if (((c1>=65) && (c1<=90)) || ((c1>=97) && (c1<=122))) c1l=true;
   if (c2l) lung++;
   if ((!c2l) && (c1l)) cuv++;
   }
fout<<lung/cuv;
}