Pagini recente » Cod sursa (job #1792096) | Cod sursa (job #524525) | Cod sursa (job #3182171) | Cod sursa (job #1753798) | Cod sursa (job #1452638)
#include<iostream>
using namespace std;
int main()
{
char c;
bool semn_punctuatie = true;
long long nr_litere = 0;
long long nr_cuv = 0;
freopen("text.in", "r", stdin);
freopen("text.out", "w", stdout);
while((c = getchar()) != EOF)
{
if(semn_punctuatie == true)
{
if((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))
{
nr_cuv++;
semn_punctuatie = false;
}
}
if((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))
nr_litere++;
else
semn_punctuatie = true;
}
cout << (int)nr_litere/nr_cuv;
return 0;
}