Advertisement
Guest User

C Code

a guest
Apr 19th, 2015
258
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. int main()
  3. {
  4. int a[5][5]={ {2,4,5,2,4}, {4,5,4,6,5}, {1,4,2,8,7}, {5,4,7,2,1}, {9,4,2,4,1} };
  5. int i,j,min=9999,max=-9999;
  6. for(i=0;i<5;i++)
  7. {
  8. printf("\n");
  9. for(j=0;j<5;j++)
  10. printf("%3d ",a[i][j]);
  11. }
  12. for(i=0;i<5;i++)
  13. {
  14. min = 9999;
  15. for(j=0;j<5;j++)
  16. {
  17. if(a[i][j]<min)
  18. min = a[i][j];
  19. }
  20. if(min > max)
  21. {
  22. max=min;
  23. }
  24. }
  25. printf("\nLon nhat trong so nho nhat/hang: %d",max);
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement