Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
wealth of banks
#include<bits/stdc++.h> using namespace std; int main() { int i,j; int m,n; cout<<"Enter the M and N value for m*n matrix:\n\n"; cin>>m>>n; int mtx[m][n]; cout<<"Enter the bank balances of different banks\nand total balances is in m*n value:\n\n"; for(i=0;i<m;i++) {for(j=0;j<n;j++) { cin>>mtx[i][j]; }} int check[m]; for(i=0;i<m;i++) {int sum=0; for(j=0;j<n;j++) { //cout<<mtx[i][j]<<" "; sum=sum+mtx[i][j]; check[i]=sum; } //cout<<" "<<check[i]<<" "; //cout<<endl; } int wealth; for(int l=0;l<m;l++) { wealth=*max_element(check,check+m); } cout<<"Maxx Wealth is: "<<wealth; return 0; }
run
|
edit
|
history
|
help
1
Procesos estocasticos Beta 2.0
Age
new delete malloc free
cppPyDicCom
selection_sort
Matrix spiral print
star print1
Inventory
nearest
test