Advertisement
Guest User

Untitled

a guest
Oct 19th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. double maxi(int n, double a[n + 1][n + 1])
  4. {
  5. int j, i;
  6. double b = -10001.000;
  7. for(i = 1; i <= n; i++)
  8. {
  9. for(j = 1; j <= n; j++)
  10. {
  11. if(a[i][j] > b)
  12. {
  13. b = a[i][j];
  14. }
  15. }
  16. }
  17. return b;
  18. }
  19.  
  20. int main ()
  21. {
  22. int n, j, i;
  23. scanf("%i", &n);
  24. double a[n + 1][n + 1];
  25. for(i = 1; i <= n; i++)
  26. {
  27. for(j = 1; j <= n; j++)
  28. {
  29. scanf("%lf", &a[i][j]);
  30. }
  31. }
  32. printf("%lf", maxi(n, a));
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement