Cod sursa(job #2516400)
Utilizator | Data | 31 decembrie 2019 12:43:34 | |
---|---|---|---|
Problema | Factorial | Scor | 0 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.47 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
char text;
int nrl, nrc;
bool ok;
int main()
{
while(fin.get(text))
{
if(isalpha(text))
{
nrl++;
ok=1;
}
else
{
if(ok==1)
nrc++;
ok=0;
}
}
if(!nrc)
fout<<0;
else
fout<<nrl/nrc;
return 0;
}