Pagini recente » Profil Neagoe_Diana_Elena_325CB | Clasament dinamica_test | Cod sursa (job #881982) | Monitorul de evaluare | Cod sursa (job #883944)
Cod sursa(job #883944)
#include <fstream>
#include <cmath>
using namespace std;
string s;
int l, i, cl, nrcuv;
int main () {
ifstream fi("text.in");
ofstream fo("text.out");
getline (fi, s); l = s.length(); cl = l; cl--;
for (i = 0; i <= cl; i++) {
if ((s[i] < 65) or (s[i] > 122) or ((s[i] < 97) and (s[i] > 90)))
l--;
}
for (i = 0; i <= cl-1; i++) {
if (((s[i] >= 97) and (s[i] <= 122)) or ((s[i] >= 65) and (s[i] <= 90)))
if ((s[i+1] < 65) or (s[i] > 122) or ((s[i] < 97) and (s[i] > 90))) {
nrcuv++;
do {
i++;
}
while ((s[i] < 65) or (s[i] > 122) or ((s[i] < 97) and (s[i] > 90)));
}
}
fo << trunc(l/nrcuv);
return 0;
}