Pagini recente » Cod sursa (job #3314781) | Monitorul de evaluare | Cod sursa (job #1860541) | Cod sursa (job #3328747) | Cod sursa (job #1730343)
#include <fstream>
#include <cmath>
using namespace std;
ifstream fin ("text.in");
ofstream fout ("text.out");
char a;
int main()
{
int ctcuv=0, ctlit=0;
bool b=false;
while(fin.get(a))
{
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<='Z' and a>='A')
{
ctlit++;
b=true;
}
}
// fout<<ctlit<<' '<<ctcuv<<'\n';
fout<<abs(ctlit/ctcuv);
return 0;
}