Pagini recente » Cod sursa (job #2606436) | Cod sursa (job #2242488) | Cod sursa (job #750213) | Cod sursa (job #2155038) | Cod sursa (job #2469023)
#include <iostream>
#include <fstream>
#include <cstring>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int main()
{
int nrcuv = 1, nrlit = 0;
char chestie[999999];
fin.getline(chestie, 999999);
for (int i = 0; i <= strlen(chestie); i++)
{
if (chestie[i] == ' ' || chestie[i] == '-') nrcuv++;
if (chestie[i]>='a'&&chestie[i]<='z'||chestie[i]>='A'&&chestie[i]<='Z') nrlit++;
}
fout << nrlit/nrcuv;
return 0;
}