Cod sursa(job #2213928)
Utilizator | Data | 17 iunie 2018 23:23:19 | |
---|---|---|---|
Problema | Text | Scor | 40 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.5 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()
{
cin.get(pars,2000000);
int c=0,nrc=0,nrl=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;
}