Pagini recente » Borderou de evaluare (job #3332143) | Cod sursa (job #1421547) | Cod sursa (job #2000121) | Cod sursa (job #1449735) | Cod sursa (job #1730340)
#include <fstream>
#include <string>
using namespace std;
ifstream fin ("text.in");
ofstream fout ("text.out");
char aux[100001], 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<<ctlit/ctcuv;
return 0;
}