1) Задание: .
При выполнении первого задания лабораторной работы была разработана блок-схема приведенная на рис.1.
Рис 1.
#include "stdafx.h"
#include <iostream>
#include <math.h>
#include "conio.h"
#include <cmath>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
double x,y;
int i;
i=2;
cout <<"vvedite X = "<<endl;
cin >>x;
cout <<"vvedite Y = "<<endl;
cin >>y;
double t=(y-(sqrt(fabs(x))));
double u=(x-(y/(x+((pow(x,i))/4))));
double o=log(double(fabs(t*u)));
cout <<"Otwet O= "<<o<<endl;
getch();
return 0;
}
2) Задание: .
При выполнении второго задания лабораторной работы была разработана блок-схема приведенная на рис.2.
Рис 2.
#include "stdafx.h"
#include <iostream>
#include <math.h>
#include "conio.h"
#include <cmath>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
int a,b;
cout <<"vvedite A: ";
cin >>a;
cout <<"vvedite B: ";
cin>>b;
double c = 1-tan(double(a));
double v = 1/(tan(double(a)));
double t = cos(double(a-b));
double x = (pow(c,v))+t;
cout <<"otvet X= "<<x<<endl;
getch();
return 0;
}
Вывод: В данной лабораторной работе мы приобрели базовые навыки работы с С++ и написали линейные программы решающие уравнения.