Pagini recente » Cod sursa (job #10687) | Borderou de evaluare (job #2155280) | Cod sursa (job #2750471) | Cod sursa (job #2461162) | Cod sursa (job #604240)
Cod sursa(job #604240)
#include<iostream>
#include<fstream>
using namespace std;
long long nrl,nrcuv;
int main(void)
{
char ch,chp='9';
fstream f("text.in",ios::in), g("text.out",ios::out);
while (f>>noskipws>>ch)
{
if ((int(ch)>=65 && int(ch)<=90)||(int(ch)>=97 && int(ch)<=122))
{
nrl++;
}
else
{
if((int(chp)>=65 && int(chp)<=90)||(int(chp)>=97 && int(chp)<=122))
nrcuv++;
}
chp=ch;
}
f.clear();
f.seekg(-1,ios::end);
f>>ch;
if ((int(ch)>=65 && int(ch)<=90)||(int(ch)>=97 && int(ch)<=122))
{
nrcuv++;
}
g<<nrl/nrcuv;
}