Pagini recente » Cod sursa (job #1554094) | Cod sursa (job #1018466) | Cod sursa (job #745181) | Cod sursa (job #2893516) | Cod sursa (job #2220104)
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
ifstream in;
in.open("text.txt");
ofstream out;
out.open("tex.txt");
int nr = 0,nr_cuv = 0,ant = 0;
char p;
while (in.get(p)){
int aux = (int)p;
if((aux > 64 && aux <91) || (aux > 96 && aux <123)){
nr++;
if(ant < 65 || ant >122 || (ant >90 && ant <97)) nr_cuv++;
}
ant = aux;
}
out << nr / nr_cuv <<endl;
return 0;
}