Cod sursa(job #2465596)
Utilizator | Data | 30 septembrie 2019 15:34:21 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.46 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream in("text.in");
ofstream out("text.out");
int main()
{
char x;
int nrcuv=0,nrlit=0;
bool ok = 0;
while (in)
{
in.get(x);
if (isalpha(x))
{
nrlit++;
ok = 1;
}
else if (ok)
{
nrcuv++;
ok = 0;
}
}
if (nrcuv == 0)
nrcuv = 1;
out << nrlit/nrcuv;
}