Cod sursa(job #757463)
| Utilizator | Data | 12 iunie 2012 09:43:49 | |
|---|---|---|---|
| Problema | Text | Scor | 40 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.54 kb |
#include <cstdio>
#include <string>
#include <iostream>
using namespace std;
string s;
int lit, nrcuv;
char bef;
int main()
{
int i;
freopen ("text.in", "r", stdin);
freopen ("text.out", "w", stdout);
getline(cin, s);
for(i = 0; i < s.size(); ++i) {
if((s[i] >= 'a' && s[i] <= 'z') || (s[i] >= 'A' && s[i] <= 'Z')) {
++lit;
if(!((bef >= 'a' && bef <= 'z') || (bef >= 'A' && bef <= 'Z')))
++nrcuv;
}
bef = s[i];
}
cout << lit / nrcuv;
return 0;
}
