Cod sursa(job #3186903)
Utilizator | AlexPlesescu AlexPlesescu | Data | 26 decembrie 2023 14:50:15 |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.63 kb |
#include <bits/stdc++.h>
using namespace std;
#define cin fin
#define cout fout
ifstream cin ("text.in");
ofstream cout ("text.out");
bool litera(char c) {
if (c >= 'A' && c <= 'Z')
return true;
else if (c >= 'a' && c <= 'z')
return true;
return false;
}
int main()
{
int lg=0,cuv=0;
char c;
bool ok = 0;
while (cin.get(c)) {
if (litera(c)) {
lg++;
ok = 1;
}
else {
if (ok)
cuv++;
ok = 0;
}
}
if (ok)
cuv++;
cout << lg/cuv;
return 0;
}