Pagini recente » Cod sursa (job #1350800) | Cod sursa (job #2046891) | Cod sursa (job #128907) | Cod sursa (job #3221497) | Cod sursa (job #1742220)
#include <cstdio>
using namespace std;
bool litera(char c){
if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))
return 1;
return 0;
}
void cuvant(int &n, char c){
while (litera(c)){
n ++;
c = getc(stdin);
}
}
int main(){
freopen("text.in", "r", stdin);
freopen("text.out", "w", stdout);
int n, cuv;
char c;
c = getc(stdin);
n = cuv = 0;
while (c != EOF){
if (litera(c)){
cuvant(n, c);
cuv ++;
}
c = getc(stdin);
}
printf("%d\n", n / cuv);
return 0;
}