Pagini recente » Cod sursa (job #2460991) | Cod sursa (job #2797775) | Cod sursa (job #1939952) | Monitorul de evaluare | Cod sursa (job #1730400)
#include <fstream>
#include <cmath>
using namespace std;
ifstream fin ("text.in");
ofstream fout ("text.out");
char a;
int main()
{
long long int ctcuv=0, ctlit=0;
bool b=false;
while(fin.get(a))
{
if(a<='z' and a>='a')
{
ctlit++;
b=true;
}
if(a<='Z' and a>='A')
{
ctlit++;
b=true;
}
if((a>=' ' and a<='@') and b==true)
{
ctcuv++;
b=false;
}
if((a>='[' and a<='`') and b==true)
{
ctcuv++;
b=false;
}
if((a>='{' and a<='~') and b==true)
{
ctcuv++;
b=false;
}
}
if(a=='\n' and b==true)
ctcuv++;
if(ctcuv==0)
ctcuv++;
// fout<<ctlit<<' '<<ctcuv<<'\n';
fout<<abs(ctlit/ctcuv);
return 0;
}