Cod sursa(job #2703360)
| Utilizator | Data | 8 februarie 2021 12:51:50 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.51 kb |
#include <cstdio>
using namespace std;
inline bool check(char ch)
{
return ((ch >= 'a' and ch <= 'z') or (ch >= 'A' and ch <= 'Z'));
}
int main()
{
freopen("text.in", "r", stdin);
freopen("text.out", "w", stdout);
char ch,ant = '0';
int l = 0,nr = 0;
while(scanf("%c", &ch) != EOF)
{
if(check(ch))
{
l++;
if(!check(ant))
nr++;
}
ant = ch;
}
printf("%d", l / nr);
return 0;
}
