Cod sursa(job #1219027)

Utilizator radudurlesteanuDurlesteanu Radu Stefan radudurlesteanu Data 13 august 2014 10:49:06
Problema Text Scor 30
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.49 kb
#include <fstream>
#include <string.h>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
char c1,c2,a[100001];
long cuv,lung,i;
bool c1l,c2l;
int main()
{
fin.get(a,100000);
while (i<strlen(a))
   {
   c1=c2;
   c2=a[i];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++;
   i++;
   }
fout<<lung/cuv;
}