action Posted December 6, 2007 at 04:26 PM Report Share #152669 Posted December 6, 2007 at 04:26 PM ola a todos! Tenho uma duvida, existe alguma maneira de ver qual e o menor(es) numero(s) introduzido pelo utilizador qundo este ta inserido numa matriz?? obrigado desde ja pela ajuda! 👍 Link to comment Share on other sites More sharing options...
nDray Posted December 6, 2007 at 04:55 PM Report Share #152674 Posted December 6, 2007 at 04:55 PM define matriz.. Mas a resposta é sim. Link to comment Share on other sites More sharing options...
filipemm Posted December 6, 2007 at 06:07 PM Report Share #152695 Posted December 6, 2007 at 06:07 PM int mat[3][3]; menor = mat[0][0]; for (x=0; x<=2; x++) for (i=0; i<=2; i++) if mat[x][i] < menor menor = mat[x][i]; É isto que queres?? Link to comment Share on other sites More sharing options...
Warrior Posted December 6, 2007 at 10:25 PM Report Share #152768 Posted December 6, 2007 at 10:25 PM Cuidado que ao declarar mat[3][3], a posição mat[3][3] fica fora dos limites. Só podemos usar 3 posições, ou seja, mat[0][0] a mat[2][2]. Link to comment Share on other sites More sharing options...
filipemm Posted December 6, 2007 at 10:46 PM Report Share #152783 Posted December 6, 2007 at 10:46 PM My bad.. como não testei esqueci-me disso... CORRIGIDO!! Link to comment Share on other sites More sharing options...
action Posted December 8, 2007 at 11:16 AM Author Report Share #153056 Posted December 8, 2007 at 11:16 AM isso tambem e ap int mat[3][3]; menor = mat[0][0]; for (x=0; x<=2; x++) for (i=0; i<=2; i++) if mat[x][i] < menor menor = mat[x][i]; É isto que queres?? licavel a uma matrix n*m???pk eu nao tou a utilizar eu tou a alocar linah e colunas atraves do calloc de ordem n+m onde o utilizador define o tamanho Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now