Pagini recente » Cod sursa (job #369134) | Cod sursa (job #2759955) | Cod sursa (job #2380795) | Cod sursa (job #433247) | 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;
}