Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- /*int argc, char *argv[]*/
- void Decimal_para_binario(int saida)
- {
- int a=saida;
- char b[32];
- itoa(a,b,2);
- printf("%s\n",b);
- getch();
- }
- void decodificadorPrintf(int *control)
- { int saida=1;
- int controlS = 16*control[0]+8*control[1]+4*control[2]+2*control[3]+control[4];
- saida = saida << controlS;
- // printf("%d\n",saida);
- Decimal_para_binario(saida);
- }
- int decodificador()
- {
- return 0;
- }
- int main(void)
- {
- int control[5];
- int i,j,k,w,q;
- printf("\n*** CECI *** \n");
- for(i=0;i<2;i++)
- {
- for ( j = 0; j < 2; j++)
- {
- for ( k = 0; k < 2; k++)
- {
- for ( w = 0; w < 2; w++)
- {
- for ( q = 0; q < 2; q++)
- {
- control[0] = i; control[1] = j;
- control[2] = k; control[3] = w;
- control[4] = q;
- //system("PAUSE");
- // printf("RAI- %d%d%d%d%d\n",control[0],control[1],control[2],control[3],control[4]);
- decodificadorPrintf(control);
- // printf("%d%d%d%d%d\n",i,j,k,w,q);
- }
- }
- }
- }
- }
- /*if(strcmp(control,"00000") == 0)
- {
- printf("SAIDA 00000000000000000000000000000001\n");
- } */
- return 0;
- }
Add Comment
Please, Sign In to add comment