1)var
a,b,h:real;
begin
readln(a);
readln(b);
readln(h);
while a<b do
begin
writeln(a,' ',2*cos(a)-1:8);
a+=h;
end
<span> end.
2)</span>var
eps,sum,current,n:real;
begin
readln(eps);
sum:=0;
n:=0;
repeat
current:=2*n-1/power(2,n);
n+=1;
sum+=current;
until current>eps;
writeln(sum);
<span>end.</span>
1*2^3+1*2^2+0*2^1+1*2^0=8+4+1=13
#include <iostream>
#include <cmath>
using namespace std;
bool is_in_square(double x, double y)
{
return ((fabs(x)<=1)&&(fabs(y)<=1));
}
int main()
{
double x, y;
cin >> x >> y;
if (is_in_square(x,y)) cout << "YES";
else cout << "No";
return 0;
}
Пример:
0.5 -0.6
YES