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
expm1
PointPattern
/
Dijkstra
prepend
Proyecto 1
Left view of a tree
HashTable
FInd rows with maximum no of 1's
wealth of banks