Cod sursa(job #2609166)
Utilizator | Data | 2 mai 2020 11:45:50 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp-64 | Status | done |
Runda | igorj_mentorat1 | Marime | 0.47 kb |
#include<iostream>
#include<fstream>
#include<cstring>
using namespace std;
ifstream f("text.in");
ofstream g("text.out");
int main()
{
char s;
int nrl=0,nrcuv=0,ok=0;
while(f.get(s))
{
if((s>='a'&&s<='z')||(s>='A'&&s<='Z'))
{
nrl++;
if(ok==0)
{
nrcuv++;
}
ok=1;
}
else
ok=0;
}
g<<nrl/nrcuv;
return 0;
}