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;
}
<span>import java.util.Locale<span>;
</span>import java.util.Scanner<span>;
</span>
public class Main {
public static void main(String[] args) {
Scanner s = new Scanner(System.in).useLocale(Locale.US)<span>;
</span></span> <span>double a = s.nextDouble()<span>;
</span></span> <span>double b = s.nextDouble()<span>;
</span></span> <span>double c = s.nextDouble()<span>;
</span></span> <span>double d = s.nextDouble()<span>;
</span></span> <span>double sum = 0.0<span>;
</span></span> <span>if (a > 5) sum += a<span>;
</span></span> <span>if (b > 5) sum += b<span>;
</span></span> <span>if (c > 5) sum += c<span>;
</span></span> <span>if (d > 5) sum += d<span>;
</span></span> <span>System.out.println(sum)<span>;
</span> }
}</span>
Uses graphabc;
begin
line(300,100,600,100);
line(200,400,500,400);
line(500,400,600,100);
line(200,400,300,100);
//
line(700,250,583,150);
line(700,250,532,300);
//
circle(520,150,30);
circle(520,150,20);
//
line(300,300,350,300);
line(300,300,200,200);
line(200,200,200,150);
line(200,150,250,150);
line(250,150,400,200);
line(400,200,400,250);
line(400,250,350,300);
//
line(225,320,150,300);
line(225,320,150,350);
line(150,350,150,300);
//
floodfill(520,150,clblack);
floodfill(600,250,clblack);
floodfill(350,250,clblack);
floodfill(210,199,clblack);
floodfill(450,350,clgray);
floodfill(155,303,clblack);
end.
#include <stdlib.h>
#include <iostream>
#include <iomanip>
using namespace std;
int main() {
const int n = 3;
const int m = 4;
int a[n][m];
int s=0;
cout << "Исходный массив" <<endl;
srand(time(0));
for (int i = 0; i < n; i++){
for (int j = 0; j < m; j++){
a[i][j]=10+(51.0 / RAND_MAX) * rand();
cout << fixed << setw (7) << a[i][j];
}
cout <<endl;
}
for (int j = 0; j < m; j++)
s = s+a[0][j]+a[n-1][j];
for (int i = 1; i < n-1; i++)
s = s+a[i][0]+a[i][m-1];
cout << "s = " << s << endl;
}
Пример:
<span>Исходный массив
55 33 24 41
50 60 41 11
17 33 45 50
s = 359</span>