Muhammad al-xorazmiy nomidagi toshkent axborot texnologiyalari universiteti algoritmlarni loyihalash fakulteti algoritmlarni loyihalash fani


Download 1.45 Mb.
Sana30.04.2023
Hajmi1.45 Mb.
#1412805


O’ZBEKISTON RESPUBLIKASI AXBOROT TEXNOLOGIYALARI VA KOMMUNIKATSIYALARINI RIVOJLANTIRISH VAZIRLIGI

MUHAMMAD AL-XORAZMIY NOMIDAGI TOSHKENT AXBOROT TEXNOLOGIYALARI UNIVERSITETI

ALGORITMLARNI LOYIHALASH FAKULTETI
ALGORITMLARNI LOYIHALASH FANI
BO’YICHA YOZGAN

1-AMALIY ISHI

Guruh: 211-21 guruh talabasi
Bajardi: Zuhriddinov Tilavoldi
Tekshirdi: Murodilloyeva Z.

Toshkent 2023.
18 – Variant.

1 – topshiriq.

#include


#include
#include

using namespace std;


int main()
{
vector> a = {{3, 4, 5}, {-1, 0, 2}, {-2, -1, 0}};
vector> b = {{0, 1, -2}, {-1, 2, 0}, {-3, -1, 0}};
vector> c(3, vector(3, 0));
cout << "\n";
for(int i = 0; i < a.size(); i++)
{
for(int j = 0; j < a[i].size(); j++)
{
c[i][j] = 2 * a[i][j] - b[i][j];
cout << c[i][j] << " ";
}
cout << endl;
}
cout << endl;
vector> d(3, vector(3, 0));
for(int i = 0; i < a.size(); i++)
{
for(int j = 0; j < a[i].size(); j++)
{
d[i][j] = 3 * a[i][j] + b[i][j];
cout << d[i][j] << " ";
}
cout << endl;
}
cout << endl;
vector> e(3, vector(3, 0));
for (int i = 0; i < c.size(); i++)
{
for (int j = 0; j < c[i].size(); j++)
{
int x=0;
for (int k = 0; k < c[i].size(); k++)
{
x+=c[i][k]*d[k][j];
}
e[i][j]=x;
cout << e[i][j] << " ";
}
cout << endl;
}
cout << endl;
vector> f(3, vector(3, 0));
for (int i = 0; i < a.size(); i++)
{
for (int j = 0; j < a[i].size(); j++)
{
int x=0;
for (int k = 0; k < a[i].size(); k++)
{
x+=a[i][k]*b[k][j];
}
f[i][j]=x;
cout << f[i][j] << " ";
}
cout << endl;
}
cout << endl;
vector> nums(3, vector(3, 0));
for (int i = 0; i < e.size(); i++)
{
for (int j = 0; j < e[i].size(); j++)
{
nums[i][j]=e[i][j]-2*f[i][j];
cout << nums[i][j] << " ";
}
cout << endl;
}
cout << "\n";
system("pause");
return 0;
}

2 – topshiriq.


To’g’ri to’rtburchak

#include


#include
#include
#include
using namespace std;
int main()
{
double a = 1.2, b = 2.1, n = 10;
double h = (b - a) / n, sum = 0;
for(int i = 1; i <= n; i++)
{
double x, f;
x = a + x * h;
f = sqrt(1.7 * pow(x, 2) + 0.5) / (1.4 + sqrt(1.2 * x + 1.3));
sum += f;
cout << "\n x = " << x << "\t f = " << f << "\t sum = " << sum << "\n";
}
cout << "\n";
system("pause");
return 0;
}


3-topshiriq
Trapetsiya


#include
#include
#include
#include
using namespace std;
int main()
{
double a = 3.2, b = 4;
int n = 10;
double h = (b - a) / n;
double f0 = 1 / sqrt(pow(a, 2) - 1);
double fn = 1 / sqrt(pow(b, 2) - 1);
double sum = f0 + fn;
cout << "\n f0 = " << f0 << "\tfn = " << fn << "\tsum = " << sum;
for(int i = 1; i < n; i++)
{
double x = a + i * h;
double f = 1 / sqrt(pow(x, 2) - 1);
sum += 2 * f;
cout << "\n x = " << "\tf = " << f << "\tsum = " << sum;
}
cout << "\n javob = " << (sum * h) / 2;
cout << "\n";
system("pause");
return 0;
}



Download 1.45 Mb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling