Advertisement
STANAANDREY

S-col

Apr 22nd, 2019
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n,m,i,j,a[100][100],S;
  6. cout<<"n=";cin>>n;
  7. cout<<"m=";cin>>m;
  8. for (i=0;i<n;i++)
  9. for (j=0;j<m;j++)
  10. cin>>a[i][j];
  11. for (j=0;j<m;j++)
  12. {
  13.     S=0;
  14.     for (i=0;i<n;i++)
  15.     S+=a[i][j];
  16.     cout<<S<<' ';
  17. }
  18.   return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement