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


Download 25.83 Kb.
Sana18.06.2023
Hajmi25.83 Kb.
#1578063
Bog'liq
7 20 Safoyeva Dilnoza 2


Topshirish. Berilgan misolni Svidji usulida va P har xil bo’lganda yechishni C++ dasturlash tilida dasturini tuzish.
DASTURI
#include
using namespace std;
int main()
{
float a[100][100]={},b[100]={},p[100]={},max;
int n,m,i,c;
double s=0;
cout<<"Assalom alekum"<cout<<"Bu dastur vazifasi:"<cout<<"Berilgan misollarni Laplas usuli yechish"<cout<<"Ustun sonini kiriting=="; cin>>n;
cout<<"Satr sonini kiriting=="; cin>>m;
for(int i=1; i<=n; i++)
{
cout<<"P["<>p[i];
}
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[i];
}
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 25.83 Kb.

Do'stlaringiz bilan baham:




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