Cod sursa(job #604238)
| Utilizator | Data | 21 iulie 2011 12:01:19 | |
|---|---|---|---|
| Problema | Text | Scor | 90 |
| Compilator | cpp | Status | done |
| Runda | Arhiva de probleme | Marime | 0.43 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;
}