Pagini recente » Cod sursa (job #2366991) | Cod sursa (job #1600707) | Cod sursa (job #543486) | Cod sursa (job #472383) | Cod sursa (job #1402861)
#include <fstream>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int nr,cuvinte;
char c,cop;
int main()
{
fin.get(c);
cop=c;
if ((c>='a' && c<='z') || (c>='A' && c<='Z'))
nr++;
while (fin.get(c))
{
if ((c>='a' && c<='z') || (c>='A' && c<='Z'))
nr++;
if ((c<'A' || (c>'Z' && c<'a') || c>'z') && ((cop>='a' && cop<='z') || (cop>='A' && cop<='Z')))
cuvinte++;
cop=c;
}
fout << nr / cuvinte;
return 0;
}