Cod sursa(job #1739302)
| Utilizator | Data | 9 august 2016 11:05:07 | |
|---|---|---|---|
| Problema | Text | Scor | 40 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.56 kb |
#include <fstream>
#include <cstring>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
char a[1048585];
bool Litera(char p)
{
return ((p >= 'A' and p <= 'Z') or (p >= 'a' and p <= 'z'));
}
int main()
{
fin.getline(a, 1048585);
int n = strlen(a);
int x = 0, y = 0;
for (int i = 0; i < n; i++)
if (Litera(a[i]))
{
x++;
if (not Litera(a[i + 1]))
y++;
}
fout << x / y << '\n';
fin.close();
fout.close();
return 0;
}
