Cod sursa(job #1993630)
Utilizator | Data | 23 iunie 2017 13:59:39 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.49 kb |
#include <fstream>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
char s;
bool cuv;
long long nrl,nrc;
int main()
{
while (fin)
{
fin.get(s);
if ((s>='a' && s<='z') || (s>='A' && s<='Z'))
{
if (!cuv)
{
cuv=1;
nrc++;
}
nrl++;
}
else if (cuv) cuv=0;
}
if(!nrc) fout << 0;
fout << nrl/nrc;
return 0;
}