Cod sursa(job #2716080)
Utilizator | Data | 4 martie 2021 18:11:28 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | vlad_oji2 | Marime | 0.41 kb |
#include <fstream>
using namespace std;
ifstream fin ("text.in");
ofstream fout ("text.out");
int main()
{
char ch;
int cntl=0,s=0,cuv=0;
while (fin.get(ch))
{
if((ch <= 'z' && ch >= 'a')|| (ch <='Z' && ch >= 'A'))
cntl++;
else
{
if(cntl > 0)
cuv ++;
s += cntl;
cntl = 0;
}
}
fout << s/cuv;
return 0;
}