Pagini recente » Cod sursa (job #376482) | Cod sursa (job #2233569) | Cod sursa (job #2088235) | Cod sursa (job #312568) | Cod sursa (job #1219036)
#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;
}