Cod sursa(job #1886601)
Utilizator | Data | 20 februarie 2017 23:34:11 | |
---|---|---|---|
Problema | Text | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.5 kb |
#include <fstream>
#include <cstring>
using namespace std;
ifstream fin("text.in");
ofstream fout("text.out");
char lit;
int nrlit,nrcuv;
bool ok;
int main()
{
while(fin.get(lit))
{
if((lit>='a' && lit<='z') || (lit>='A' && lit<='Z'))
{
nrlit++;
ok=1;
}
else if(ok==1)
{
nrcuv++;
ok=0;
}
}
fout<<nrlit/nrcuv;
fin.close();
fout.close();
return 0;
}