Advertisement
STANAANDREY

SUma_nr_mat

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