Pagini recente » Cod sursa (job #2861003) | Cod sursa (job #1904602) | Cod sursa (job #2677308) | Cod sursa (job #2141996) | Cod sursa (job #1929389)
#include <iostream>
#include <fstream>
using namespace std;
ifstream in("text.in");
ofstream out("text.out");
string s;
unsigned long long nr, w, l;
bool letter(char x){
if(('a'<=x&&x<='z')||('A'<=x&&x<='Z'))return true;
return false;
}
int main(){
getline(in, s);
w=0;
for(int i=0; i<s.size(); i++){
if(letter(s[i])){
w++;
}else{
if(w>0)nr++;
l+=w;
w=0;
}
}
out<<l/nr;
return 0;
}