Pagini recente » Cod sursa (job #1450822) | Cod sursa (job #1105755) | Cod sursa (job #156450) | Cod sursa (job #3121969) | Cod sursa (job #2781558)
#include <bits/stdc++.h>
using namespace std;
ifstream fin ("text.in");
ofstream fout("text.out");
int main() {
char a[255];
fin.get(a, 255);
int tot = 0, nr = 0;
for(int i = 0; i < strlen(a); i++) {
if((a[i] >= 'a' && a[i] <= 'z') || (a[i] >= 'A' && a[i] <= 'Z')) {
nr++;
while((a[i] >= 'a' && a[i] <= 'z') || (a[i] >= 'A' && a[i] <= 'Z')) { i++; tot++; }
}
}
fout << tot / nr << '\n';
}