Pagini recente » Cod sursa (job #1729012) | Cod sursa (job #1754180) | Cod sursa (job #828528) | Cod sursa (job #2708816) | Cod sursa (job #2222381)
#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;
}