Pagini recente » Cod sursa (job #1129657) | Cod sursa (job #2169907) | Cod sursa (job #2560873) | Cod sursa (job #2658834) | Cod sursa (job #686480)
Cod sursa(job #686480)
#include <iostream>
#include <cstring>
#include <fstream>
using namespace std;
int main()
{
freopen("text.in", "r", stdin);
freopen("text.out", "w", stdout);
char *text;
long lit = 0, cuv = 0;
text = new char[2000];
cin>>text;
fclose(stdin);
bool ic = 0;
while(*text)
{
if((*text >= 'a' && *text <= 'z') || (*text >= 'A' && *text <= 'Z'))
{
if(!ic)
{
ic = 1;
++cuv;
}
++lit;
}
else
ic = 0;
text++;
}
cout<<(int)lit/cuv<<"\n";
fclose(stdout);
return 0;
}