Advertisement
Guest User

allahu akbar lsdx anax

a guest
Nov 21st, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. using namespace std;
  4.  
  5. ifstream fin("matrice.in");
  6.  
  7. int n, s=0;
  8.  
  9. int main()
  10. {
  11.  
  12. fin>>n;
  13.  
  14. int v[n][n];
  15.  
  16. for(int i=1;i<=n;i++)
  17. for(int j=1;j<=n;j++)
  18. fin>>v[i][j];
  19.  
  20. for(int i=1;i<=n;i++)
  21. for(int j=1;j<=n;j++)
  22. if(i>j)
  23. s += v[i][j];
  24.  
  25. cout<<s;
  26.  
  27.  
  28. return 0;
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement