Pagini recente » Cod sursa (job #2313400) | Cod sursa (job #97606) | Cod sursa (job #3120903) | Cod sursa (job #2511587) | Cod sursa (job #2469022)
#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[9999];
fin.getline(chestie, 9999);
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;
}