Cod sursa(job #2532113)
| Utilizator | Data | 27 ianuarie 2020 13:12:09 | |
|---|---|---|---|
| Problema | Text | Scor | 100 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.58 kb |
#include <fstream>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
char x,y;
int nrc,nrl;
bool litx,lity;
int main()
{
fin.get(y);
if(y>='a'&&y<='z'||y>='A'&&y<='Z')
{
nrl++;
lity=1;
}
while(fin.get(x))
{
if(x>='a'&&x<='z'||x>='A'&&x<='Z')
{
nrl++;
litx=1;
}
else
{
litx=0;
if(lity==1)
nrc++;
}
y=x;
lity=litx;
}
fout<<nrl/nrc;
return 0;
}
