Cod sursa(job #2072255)
| Utilizator | Data | 21 noiembrie 2017 17:14:04 | |
|---|---|---|---|
| Problema | Text | Scor | 30 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.56 kb |
#include <fstream>
#include <cstring>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
int i,nrl,nrcuv,k,n;
char c[1000002];
int main()
{
fin.getline(c,1000002);
n=strlen(c);
for(i=1;i<=n;i++)
{
if(k==1&&c[i]>='A'&&c[i]<='z')
{
nrl++;
}
if(k==0&&c[i]>='A'&&c[i]<='z')
{
k=1;
nrcuv++;
nrl++;
}
if(k==1&&c[i]<'A'||c[i]>'z')
{
k=0;
}
}
fout<<nrl/nrcuv;
return 0;
}
