Pagini recente » Cod sursa (job #1232078) | Cod sursa (job #2675757) | Cod sursa (job #3161318) | Cod sursa (job #1566519) | Cod sursa (job #1730363)
#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;
}
}
if(a=='\n')
ctcuv++;
// fout<<ctlit<<' '<<ctcuv<<'\n';
fout<<abs(ctlit/ctcuv);
return 0;
}