Cod sursa(job #1251436)
Utilizator | Data | 29 octombrie 2014 14:45:19 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.53 kb |
#include <fstream>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int nrl,nrc,ok;
char x;
int main()
{
nrl = 0;
nrc = 0;
while(f.get(x))
{
if((x >= 'a' && x <= 'z') || (x >= 'A' && x <= 'Z'))
{
nrl++;
ok = 1;
}
else
{
if(ok == 1)
nrc++;
ok = 0;
}
}
if(ok == 1)
nrc++;
if(nrl == 0)
nrc++;
g<<nrl/nrc;
return 0;
}