Advertisement
Guest User

Untitled

a guest
May 24th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. void tinhtichmatran(float *a, int n, int m){
  2. int i, j,min;
  3. int *tich=(int *)malloc(100*sizeof(int*));
  4. if(n==m){
  5. for(i=1; i<=m; i++){
  6. *(tich+i) =1;
  7. for(j=1; j<=m; j++){
  8. *(tich+i) =*(tich+i) * (*(a+m*j+i));
  9. }
  10. printf("\nTich cac phan tu cua cot thu %d la %d\n", i, *(tich+i));
  11. for(int i=2;i<=n;i++){
  12. min=*(tich+1);
  13. if(min>*(tich+i)){
  14. min=*(tich+i);
  15. }
  16. }
  17. }
  18. printf("\nNho Nhat la Cot Thu : %d",min);
  19. }
  20. else if(n<m){
  21. for(i=1; i<=n+1; i++){
  22. *(tich+i) =1;
  23. for(j=1; j<m; j++){
  24. *(tich+i) =*(tich+i) * (*(a+m*j+i));
  25. }
  26. printf("\nTich cac phan tu cua cot thu %d la %d\n", i, *(tich+i));
  27. }
  28. }
  29. else{
  30. for(i=1; i<=m; i++){
  31. *(tich+i) =1;
  32. for(j=1; j<=n; j++){
  33. *(tich+i) =*(tich+i) * (*(a+m*j+i));
  34. }
  35. printf("\nTich cac phan tu cua cot thu %d la %d\n", i, *(tich+i));
  36. }
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement