Pagini recente » Cod sursa (job #2491281) | Cod sursa (job #1476390) | Cod sursa (job #2806432) | Cod sursa (job #699637) | Cod sursa (job #2220105)
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
ifstream in;
in.open("text.in");
ofstream out;
out.open("text.out");
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;
}