Topshirish. Berilgan misolni Laplas usulida va p bir XIL bo’lganda yechishni C++ dasturlash tilida dasturini tuzish. Dasturi


Download 90.88 Kb.
Sana01.05.2023
Hajmi90.88 Kb.
#1419589
Bog'liq
7 20 Safoyeva Dilnoza


Topshirish. Berilgan misolni Laplas usulida va P bir xil bo’lganda yechishni C++ dasturlash tilida dasturini tuzish.
DASTURI
#include
using namespace std;
int main()
{
float a[100][100]={},b[100]={},p,max;
int n,m,i,c;
double s=0;
cout<<"Assalom alekum"<cout<<"Bu dastur vazifasi:"<cout<<"Berilgan misollarni Laplas usuli yechish"<cout<<"P kiriting=="; cin>>p;
cout<<"Ustun sonini kiriting=="; cin>>n;
cout<<"Satr sonini kiriting=="; cin>>m;
for(int i=1; i<=n; i++)
{
for(int j=1; j<=m; j++)
{
cout<<"a["<>a[i][j];
}
}
cout<<"||||||||||||||||||||||||||||||||||||||||||||||||||||||||"<cout<<"siz kiritgan elememtlar jadvali"<cout<<" ";
for(int j=1; j<=m; j++)
{
cout<<"|"<<"T"<}
cout<<"\n";
cout<<"----------------------------------------------------"<for(int i=1; i<=n; i++)
{
cout<<"A"<for(int j=1; j<=m; j++)
{
cout<}
cout<<"\n";
}
for(int i=1; i<=n; i++)
{
s=0;
for(int j=1; j<=m; j++)
{
s=s+a[i][j];
}
b[i]=s/p;
}
cout<<"----------------------------------------------------"<cout<<"||||||||||||||||||||||||||||||||||||||||||||||||||||||||"<cout<<"P qator qo'shildi"<cout<<" ";
for(int j=1; j<=m; j++)
{
cout<<"|"<<"T"<}
cout<<"\t"<<"|"<<"P";
cout<<"\n";
cout<<"----------------------------------------------------"<for(int i=1; i<=n; i++)
{
cout<<"A"<for(int j=1; j<=m; j++)
{
cout<}
cout<<"\t"<<"|"<
cout<<"\n";
}
cout<<"----------------------------------------------------"<cout<<"||||||||||||||||||||||||||||||||||||||||||||||||||||||||"<cout<<"Har bir satr umumiy yig'indisiga Pga bo'lganda"<cout<<" ";
for(int j=1; j<=m; j++)
{
cout<<"|"<<"T"<}
cout<<"\t"<<"|"<<"P";
cout<<"\n";
cout<<"----------------------------------------------------"<for(int i=1; i<=n; i++)
{
cout<<"A"<for(int j=1; j<=m; j++)
{
cout<}
cout<<"\t"<<"|"<
cout<<"\t"<<"|"<cout<<"\n";
}
max=b[i];
for(int i=1; i<=n; i++)
{
if(max>=b[i])
{
max=max;
c=i;
}
else
{
max=b[i];
c=i;
}
}
cout<<"----------------------------------------------------"<cout<<"A"<return 0;
}
NATIJA:






Download 90.88 Kb.

Do'stlaringiz bilan baham:




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