Pagini recente » Cod sursa (job #1478003) | Cod sursa (job #1801205) | Cod sursa (job #2891252) | Cod sursa (job #2286378) | Cod sursa (job #1512715)
#include <fstream>
#include <cstring>
using namespace std;
ifstream f ("text.in");
ofstream g ("text.out");
char a[100000];
int k, z, n, i;
bool ok = false;
int main()
{
f.get(a,100000,'\n');
n = strlen(a);
for (i = 0; i < n; i++){
while ((a[i] >= 65 && a[i] <= 90) || (a[i] >= 97 && a[i] <= 122))
{
if (ok == false){
z++;
ok = true;
}
k++;
i++;
}
if (ok == true){
ok = false;
i--;
}
}
g << k / z;
return 0;
}