Pagini recente » Cod sursa (job #2539826) | Cod sursa (job #2281922) | Cod sursa (job #1415557) | Cod sursa (job #2312565) | 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;
}