Tranvick

Untitled

May 14th, 2012
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.24 KB | None | 0 0
  1. #include <cstdio>
  2.  
  3. int main(){
  4.     int a[5][5],res=0;
  5.     for (int i=1;i<5;++i)
  6.         for (int j=1;j<5;++j) scanf("%d",&a[i][j]);
  7.     for (int i=1;i<5;++i)
  8.         for (int j=i+1;j<5;++j) if (a[i][j]>0) res+=a[i][j];
  9.     printf("%d\n",res);
  10.     return 0;
  11. }
Advertisement
Add Comment
Please, Sign In to add comment