Topshirish. Berilgan misolni Svidji usulida va p har XIL bo’lganda yechishni C++ dasturlash tilida dasturini tuzish. Dasturi
Download 25.83 Kb.
|
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<<"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<<"||||||||||||||||||||||||||||||||||||||||||||||||||||||||"< for(int j=1; j<=m; j++) { cout<<"|"<<"T"< cout<<"\n"; cout<<"----------------------------------------------------"< { 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<<"----------------------------------------------------"< for(int j=1; j<=m; j++) { cout<<"|"<<"T"< cout<<"\t"<<"|"<<"P"; cout<<"\n"; cout<<"----------------------------------------------------"< { cout<<"A"<for(int j=1; j<=m; j++) { cout<} cout<<"\t"<<"|"< cout<<"\n"; } cout<<"----------------------------------------------------"< for(int j=1; j<=m; j++) { cout<<"|"<<"T"< cout<<"\t"<<"|"<<"P"; cout<<"\n"; cout<<"----------------------------------------------------"< { 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<<"----------------------------------------------------"< } NATIJA: Download 25.83 Kb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling