Cod sursa(job #1929389)
| Utilizator | Data | 17 martie 2017 16:01:22 | |
|---|---|---|---|
| Problema | Text | Scor | 40 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.5 kb |
#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;
}
