Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
- #include "my-func.h"
- int main(){
- int x,y,m,n,r,f,c,pos,i,j,nbts,nBts,dato,max,aux,auxm,auxn;
- double t;
- printf("Elija una opcion 0: suma 1: multiplica\n");
- scanf("%d",&x);
- if(x==0){
- scanf("%d %d",&f,&c);
- t = (f*c)/8;
- nbts = 2;
- printf("¿Cuantos elementos no nulos tendra su matriz?\n");
- scanf("%d",&r);
- int matriz1[r];
- unsigned char map1,map2;
- map1 = Initarray(map1,nbts);
- map2 = Initarray(map2,nbts);
- printf("Ingrese valor del elemento y coordenadas\n");
- for(i=0;i<r;i++){
- scanf("%d %d %d",&matriz1[i],&m,&n);
- auxm = m;
- auxn = n;
- if (f < c)
- max = c;
- else
- max = f;
- pos = ((max*(auxm-1))+(auxn-1));
- printf("%d\n",pos);
- map1 = Setbit(map1,pos);
- for (int i = 0; i < 8; i++){
- if ((map1 & (1 << i)) != 0 ){
- printf("rata\n");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement