Pagini recente » Cod sursa (job #122288) | Cod sursa (job #863228) | Cod sursa (job #1891722) | Cod sursa (job #2806756) | Cod sursa (job #905581)
Cod sursa(job #905581)
#include<fstream>
#include<cstring>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
string s;
inline void citire()
{
getline(fin, s);
}
int main()
{
citire();
long long nr_cuv = 0, litere = 0;
for(long long i = 0; i < s.length(); ++i)
{
if((s[i] >= 'a' and s[i] <= 'z') or (s[i] >= 'A' and s[i] <= 'Z'))
{
nr_cuv++;
while((s[i] >= 'a' and s[i] <= 'z') or (s[i] >= 'A' and s[i] <= 'Z'))
{
++litere;
++i;
}
}
}
long long sol = litere / nr_cuv;
fout << sol;
return 0;
}