Pagini recente » Cod sursa (job #125332) | Cod sursa (job #2747490) | Cod sursa (job #742865) | Istoria paginii runda/oni2012_ziua1/clasament | Cod sursa (job #2326447)
#include <iostream>
#include <fstream>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
char x;
int nr_lit, nr_cuv;
bool ok;
bool litera(char x)
{
return (x >= 'a' && x <= 'z' || x >= 'A' && x <= 'Z');
}
int main()
{
while(fin.get(x))
{
if(litera(x))
{
if(!ok)nr_cuv++;
nr_lit++;
ok = 1;
}
else ok = 0;
}
fout << nr_lit / nr_cuv;
}