Cod sursa(job #879610)
#include <iostream>
#include <fstream>
#include <string.h>
using namespace std;
int main() {
ifstream f("text.in");
ofstream g("text.out");
char prop[100];
f.get(prop,100);
int i, nrCuvinte=0, lungime=strlen(prop), asciiCode;
for(i=0; i<lungime; i++) {
asciiCode=(int)prop[i];
if((asciiCode>64 && asciiCode< 91) || (asciiCode>96 && asciiCode<123)) {
nrCuvinte++;
strcpy(prop+i,prop+1+i);
}
}
asciiCode=(int)prop[lungime];
if((asciiCode>64 && asciiCode< 91) || (asciiCode>96 && asciiCode<123)) {
nrCuvinte++;
g<<strlen(prop)/nrCuvinte;
}
else {
nrCuvinte++;
g<<(strlen(prop)-1)/nrCuvinte;
}
return 0;
}