Cod sursa(job #604239)
Utilizator | Data | 21 iulie 2011 12:02:16 | |
---|---|---|---|
Problema | Text | Scor | 70 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.44 kb |
#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;
}
g<<nrl/(nrcuv+1);
}