Advertisement
rengetsu

ProcedurProgramavimas_2.09

Mar 12th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.43 KB | None | 0 0
  1. #include <iostream>
  2. #include <iomanip>
  3. using namespace std;
  4. int main()
  5. {
  6. double q=0,r=0, didz=-1000001, ats;
  7. int sum=0, f[11][11], u=99;
  8. cin>>q>>r;
  9. for(int i=0;i<q;i++)
  10. {
  11.     for(int z=0;z<r;z++)
  12.     {
  13.     cin>>f[i][z];
  14.         if(f[i][z]>didz)
  15.         {
  16.         didz=f[i][z];
  17.         u=i;
  18.         }
  19.     }
  20. }
  21. for(int j=0;j<r;j++)
  22. {
  23.     sum+=f[u][j];
  24. }
  25. ats=sum/r;
  26. cout<<fixed<<setprecision(2)<<ats<<endl;
  27. return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement