Pagini recente » Cod sursa (job #2463756) | Cod sursa (job #2518686) | Cod sursa (job #3221473) | Cod sursa (job #3161709) | Cod sursa (job #2232494)
#include <iostream>
#include <fstream>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
char text[10000];
bool litera(char c)
{
if(( int(c) >= 'a' && int(c) <= 'z') || (int(c) >= 'A' && int(c) <= 'Z')) return true;
return false;
}
int main()
{
int i=0;
int nrL = 0;
int nrC = 0;
bool k = false;
while(f.get(text[i]))
{
if(litera(text[i]))
{
nrL++;
k = 1;
}
else
{
if(k) nrC++;
k=0;
}
i++;
}
g << nrL/nrC;
return 0;
}