Учитываем что 11111111 в двоичной, это 255 десятичной
1) Черный
2) Красный
3) Зелёный
4) Синий
5) Сине-зелёный (Циан)
6) Сине-красный (Пурпурный)
7) Красно-зелёный (Жёлтый)
8) Белый
Begin
var a := ReadInteger('a =');
PrintLn(
Range(1, ReadInteger('n ='))
.Where(x -> (x mod 5 = 0) and (x < a))
.Aggregate((s, x)-> s + x)
);
end.
Ответ предоставлен в файле для лучшей читаемости кода.
Var N,k,sum : Integer;
Begin
sum:=0;
Readln(N,k);
While N>0 do
Begin
If (N mod 10)>k then sum:=sum+(N mod k);
N:=N div 10;
end;
end.
или так
Var N,k,sum : Integer;
Begin
sum:=0;
Readln(N,k);
While N>0 do
Begin
sum:=sum+(N mod 10)*Ord((N mod 10)>k);
N:=N div 10;
end;
end.
или так
Var N,k : Integer;
Function sum(N,k : Integer) : Integer;
Begin
If (N>0) and ((N mod 10)>k) then sum:=(N mod 10)+sum(N div 10,k) else sum:=0;
end;
Begin
Readln(N,k);
Writeln(sum(N,k));
end.
A)
#include <iostream>
<span>
#include "math.h"</span>
using namespace std;
int main()
{
const double Pi = 3.14;
double x,y;
<span> cin >> x;
</span>
y=((2*pow(sin(x),2))/(Pi*x)-atan(x));
cout << y << endl;
<span>}
б)
</span>#include <iostream>
<span>
<span>#include <cmath>
</span></span>double log(double a, double b)
{
return log(b) / log(a);
}
using namespace std;
int main()
{
double x,y;
cin >> x;
y=log(5,abs(x-12.5*pow(x,9))+((2*x-4)/(abs(pow(x,8)-12*pow(x,4)+5.1*pow(x,3)))));
cout << y << endl;
}