Cod sursa(job #2140469)
Utilizator | Data | 23 februarie 2018 15:28:07 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.35 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
char c;
int nr, t;
bool ok;
int main()
{
while (fin.get(c))
{
if ((c >= 'a'&&c <= 'z') || (c >= 'A'&&c <= 'Z'))
{
if (ok == false) { ok = true; nr++; }
t++;
}
else ok = false;
}
fout << t / nr;
return 0;
}