Cod sursa(job #2214361)
Utilizator | MACHEAMACUMVREAU NOSCOPEPROKENDY | Data | 18 iunie 2018 20:34:16 |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.54 kb |
#include<fstream>
using namespace std;
ifstream cin("text.in");
ofstream cout("text.out");
char pars[2000000];
bool elitera(char x)
{
if(('a'<=x && x<='z') || ('A'<=x && x<='Z')) return 1;
return 0;
}
int main()
{
int c,nrc=0,nrl=0;
while(cin.getline(pars,2000000))
{
c=0;
for(int i=0;pars[i]!=0;i++)
if(elitera(pars[i]))
{
++nrl;
if(c==0)
{
c=1; ++nrc;
}
}
else c=0;
}
cout<<nrl/nrc;
}