Pagini recente » Cod sursa (job #696536) | Cod sursa (job #1302826) | Cod sursa (job #1946141) | Cod sursa (job #102830) | Cod sursa (job #1742212)
#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 != '\n' && c != EOF){
if (litera(c)){
cuvant(n, c);
cuv ++;
}
c = getc(stdin);
}
printf("%d\n", n / cuv);
return 0;
}