Pagini recente » Cod sursa (job #1887804) | Cod sursa (job #567255) | Cod sursa (job #1249528) | Cod sursa (job #1125154) | Cod sursa (job #1546274)
#include <iostream>
#include <fstream>
#include <string.h>
//#include <vector>
//#include <queue>
//#include <algorithm>
using namespace std;
const int nmax = 1000;
char s[nmax];
int main(){
freopen("text.in", "r", stdin);
freopen("text.out", "w", stdout);
fgets(s, nmax, stdin);
unsigned long long litere = 0, nrCuvinte = 0;
int p = 0;
for (int i = 0; s[i] != '\0'; i++) {
if (isalpha(s[i])) {
if (!p) {
p = 1; nrCuvinte++;
}
else p++;
}
else {
if (p){
litere += p; p = 0;
}
};
}
if (!p) litere += p;
printf("%lld ", litere/nrCuvinte);
fclose(stdin);
fclose(stdout);
return 0;
}