Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void tinhtichmatran(float *a, int n, int m){
- int i, j,min;
- int *tich=(int *)malloc(100*sizeof(int*));
- if(n==m){
- for(i=1; i<=m; i++){
- *(tich+i) =1;
- for(j=1; j<=m; j++){
- *(tich+i) =*(tich+i) * (*(a+m*j+i));
- }
- printf("\nTich cac phan tu cua cot thu %d la %d\n", i, *(tich+i));
- for(int i=2;i<=n;i++){
- min=*(tich+1);
- if(min>*(tich+i)){
- min=*(tich+i);
- }
- }
- }
- printf("\nNho Nhat la Cot Thu : %d",min);
- }
- else if(n<m){
- for(i=1; i<=n+1; i++){
- *(tich+i) =1;
- for(j=1; j<m; j++){
- *(tich+i) =*(tich+i) * (*(a+m*j+i));
- }
- printf("\nTich cac phan tu cua cot thu %d la %d\n", i, *(tich+i));
- }
- }
- else{
- for(i=1; i<=m; i++){
- *(tich+i) =1;
- for(j=1; j<=n; j++){
- *(tich+i) =*(tich+i) * (*(a+m*j+i));
- }
- printf("\nTich cac phan tu cua cot thu %d la %d\n", i, *(tich+i));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement