Pagini recente » Cod sursa (job #2145553) | Cod sursa (job #116215) | Cod sursa (job #1427692) | Cod sursa (job #1301032) | Cod sursa (job #2515935)
#include <iostream>
#include <fstream>
#include <iomanip>
#include <string>
#include <istream>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int main()
{
string str;
getline(fin, str);
int pozI = -1;
int i = 0;
while (pozI == -1)
{
if (isalpha(str[i]))
pozI = i;
i++;
}
i = str.length();
int pozF = -1;
while (pozF == -1)
{
if (isalpha(str[i]))
pozF = i;
i--;
}
int charContor = 0;
for (int i = pozI; i < pozF; i++)
if (!isalpha(str[i]) && (isalpha(str[i - 1])))
charContor++;
int numarLitere = pozF - pozI - charContor + 1;
int numarCuvinte = charContor + 1;
f out << numarLitere / numarCuvinte;
system("pause>nul");
}