Cod sursa(job #3137056)
Utilizator | Data | 10 iunie 2023 20:38:53 | |
---|---|---|---|
Problema | Text | Scor | 10 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.44 kb |
#include <fstream>
using namespace std;
ifstream fin ("text.in");
ofstream fout ("text.out");
int i,nrs,nrlg,cv;
char ch;
int main()
{
while (fin>>ch)
{
if ((ch>='a'&&ch<='z')||(ch>='A'&&ch<='Z'))
{
nrs++;
nrlg++;
}
else if (nrs>0)
{
nrs=0;
cv++;
}
}
if (nrs>0)
cv++;
fout<<nrlg/cv;
return 0;
}