O‘zbekiston respublikasi axborot texnologiyalari va kommunikatsiyalarini rivojlantirish vazirligi muhammad al-xorazmiy nomidagi




Download 3.53 Mb.
Sana28.05.2023
Hajmi3.53 Mb.
#66279
Bog'liq
algoritm
Azizbek 1, Док, c5a8fbc8-a23d-4d79-a6b7-d7e5f447c243, Azizbek , kt 8, Extimollar, Mavzu To’plamlarda akslantirishlar, ularning xossalari funksiya, kiberxafsizlik Yoqubov Azizbek amaliy, Amaliy ish4, exitmol, MUSTAQIL ISH KT, O’zbekiston respublikasi oliy va o`rta maxsus ta`lim vazirligi n



O‘ZBEKISTON RESPUBLIKASI AXBOROT TEXNOLOGIYALARI VA
KOMMUNIKATSIYALARINI RIVOJLANTIRISH VAZIRLIGI
MUHAMMAD AL-XORAZMIY NOMIDAGI
TOSHKENT AXBOROT TEXNOLOGIYALARI UNIVERSITETI
Kompyuter injiniring fakulteti

Algoritmlarni loyihalash fanidan


Amaliy ishi

Bajardi:Yoqubjonov Azizbek


Tekshirdi: Nasriddinov Saloxiddin
Toshkent 2023

1-topshiriq matritsalar ustida amallar



#include
using namespace std;

int main() {


int m, n, p, q;
cout << "Enter the dimensions of the first matrix: ";
cin >> m >> n;
cout << "Enter the dimensions of the second matrix: ";
cin >> p >> q;

// Checking if multiplication is possible


if (n != p) {
cout << "Matrices cannot be multiplied.";
return 0;
}

int mat1[m][n], mat2[p][q], product[m][q], qiymat1[m][n], qiymat2[m][n];

// Taking input for the first matrix
cout << "Enter the elements of the first matrix:" << endl;
for (int i = 0; i < m; i++) {
for (int j = 0; j < n; j++) {
cin >> mat1[i][j];
}
}

// Taking input for the second matrix


cout << "Enter the elements of the second matrix:" << endl;
for (int i = 0; i < p; i++) {
for (int j = 0; j < q; j++) {
cin >> mat2[i][j];
}
}

// Multiplying matrices and storing result in product matrix


for (int i = 0; i < m; i++) {
for (int j = 0; j < q; j++) {
product[i][j] = 0; qiymat1[i][j]=0, qiymat2[i][j]=0;
for (int k = 0; k < n; k++) {
qiymat1[k][j]=3*mat2[k][j];
qiymat2[k][j]=(mat1[i][k]*mat2[k][j]-2*mat1[i][k]);

product[i][j] += 2*mat1[i][k] +qiymat1[k][j]*qiymat2[k][j];
}
}
}

// Printing the product matrix


cout << "Product of the matrices is:" << endl;
for (int i = 0; i < m; i++) {
for (int j = 0; j < q; j++) {
cout << product[i][j] << " ";
}
cout<cout<for (int i = 0; i < m; i++) {
for (int j = 0; j < q; j++) {
cout<}
cout<cout<for (int i = 0; i < m; i++) {
for (int j = 0; j < q; j++) {
cout<}
cout << endl;
}

return 0;


}
2-topshiriq

To`gri to`rtburchak usuli
#include
#include
using namespace std;
int main(){
double a=1, b=2.6, h, n=10, x,s=0, f;

h=(b-a)/n;
for(int i=1; i<=n; i++){
x=a+i*h;
s+=sqrt(0.4*x+3)/(0.7*x+sqrt(2* pow(x,2)+0.5));
cout<<"s="<}
f=s*h;
cout<<"summa="<
return 0;
}
Trapetsiya usuli va simpson usuli
#include
#include
using namespace std;
int main(){
double a=1.4, b=2, n=8, h, x, s=0, x1, xn,f;
h=(b-a)/n;
x1=a+h;
xn=a+10*h;
for(int i=1; ix=a+(i+1)*h;
x=2*x;
s+=1/(sqrt(pow(x,2)+0.7));
s+=1/(sqrt(pow(x1,2)+0.7));
s+=1/(sqrt(pow(xn,2)+0.7));cout<<"s="<}

f=s*h/2;
cout<<"f="<

return 0;
}

Simpson usuli


#include
#include
#include
using namespace std;
float f(float x) { return log(x*x+0.8)/ (x-1);}
int i,m; float a = 2.5,b = 3.3,n = 8,h,s;
int main( int argc,char argv[])
{
cout<<"Integralni Simpson usulida hisoblash"<h=(b-a)/n;cout<<"h = "<float x[8];
for(i=1;i<=n;i++)
{
x[i] = a + i * h;
if (i % 2 == 0)
{
s += 2 * f(x[i]);
cout<<"s="<}
else {
s += 4 * f(x[i]);
}
s += s;
cout<<"s="<}
s=s*h/3;
cout<<"integral = "<}

3-topshiriq


. ЧД М ни симплекс усулда ечиш
𝐹 = −𝑥1+3𝑥2+2𝑥3 → 𝑚𝑖𝑛
{
𝑥1+𝑥2+2𝑥3 ≥ −5
2𝑥1−3𝑥2 + 𝑥3 ≤ 3
𝑥1 − 5𝑥2+6𝑥3 ≤ 5
𝑥𝑗 ≥ 0, 𝑗 = 1,2,3


Download 3.53 Mb.




Download 3.53 Mb.

Bosh sahifa
Aloqalar

    Bosh sahifa



O‘zbekiston respublikasi axborot texnologiyalari va kommunikatsiyalarini rivojlantirish vazirligi muhammad al-xorazmiy nomidagi

Download 3.53 Mb.