Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. p=&matriz[0][0];
  2.  
  3. if(*(p+ord-1)==num)
  4. {
  5. return 1;
  6. }
  7. else if(*(p+ord-1)!=num);
  8. {
  9. return (checainteiro(matriz, num, ord-1));
  10. }
  11. if(*(p+ord-1)!=num && (ord-1)==0)
  12. {
  13. return 0;
  14. }
  15.  
  16. printf("n----Construcao da Matriz----nn");
  17. for(i=0; i<linhas; i++)
  18. {
  19. for(j=0; j<colunas; j++)
  20. {
  21. printf("Elemento[%d][%d] = ", i, j);
  22. scanf("%d", &matriz[i][j]);
  23. }
  24. printf("n");
  25. }
  26.  
  27. printf("n----Construcao da Matriz----nn");
  28. for(i=0; i<linhas; i++)
  29. {
  30. for(j=0; j<colunas; j++)
  31. {
  32. printf("Elemento[%d][%d] = %d ", i, j, matriz[i][j]);
  33.  
  34. }
  35. printf("n");
  36. }
  37.  
  38.  
  39.  
  40. printf("Digite um inteiro para checar sua ocorrencia na matriz: ");
  41. scanf("%d", &num);
  42.  
  43. if((checainteiro(matriz,num, linhas*colunas))==1)
  44. {
  45. printf("O numero %d ocorre na matriz!n", num);
  46. }
  47. else
  48. {
  49. printf("O numero nao %d ocorre na matriz!n", num);
  50. }
  51.  
  52. return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement