Advertisement
rengetsu

ProcedurProgramavimas_2.10

Mar 12th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.39 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. using namespace std;
  4. int main()
  5. {
  6. double q,k=0,sum=0,d=0,w=0;
  7. int f[11][11];
  8. cin>>q;
  9. for(int i=0;i<q;i++)
  10. {
  11.     if(i!=0){w++;}
  12.     for(int z=0;z<q;z++)
  13.     {
  14.     cin>>f[i][z];
  15.         if(i!=0 && z<q-(q-w))
  16.         {
  17.             sum+=f[i][z];
  18.             d++;
  19.         }
  20.     }
  21. }
  22. if(d==0){cout<<"No"<<endl;}else{cout<<sum<<endl;}
  23. return 0;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement