Advertisement
Guest User

codigo

a guest
Jan 23rd, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <math.h>
  4. #include "my-func.h"
  5.  
  6.  
  7. int main(){
  8. int x,y,m,n,r,f,c,pos,i,j,nbts,nBts,dato,max,aux,auxm,auxn;
  9. double t;
  10. printf("Elija una opcion 0: suma 1: multiplica\n");
  11. scanf("%d",&x);
  12. if(x==0){
  13. scanf("%d %d",&f,&c);
  14. t = (f*c)/8;
  15. nbts = 2;
  16. printf("¿Cuantos elementos no nulos tendra su matriz?\n");
  17. scanf("%d",&r);
  18. int matriz1[r];
  19. unsigned char map1,map2;
  20. map1 = Initarray(map1,nbts);
  21. map2 = Initarray(map2,nbts);
  22. printf("Ingrese valor del elemento y coordenadas\n");
  23. for(i=0;i<r;i++){
  24. scanf("%d %d %d",&matriz1[i],&m,&n);
  25. auxm = m;
  26. auxn = n;
  27. if (f < c)
  28. max = c;
  29. else
  30. max = f;
  31. pos = ((max*(auxm-1))+(auxn-1));
  32. printf("%d\n",pos);
  33. map1 = Setbit(map1,pos);
  34. for (int i = 0; i < 8; i++){
  35. if ((map1 & (1 << i)) != 0 ){
  36. printf("rata\n");
  37. }
  38. }
  39. }
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement