Advertisement
Guest User

Untitled

a guest
Mar 17th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.07 KB | None | 0 0
  1. #define num(a,b,c,d,e,f,g,h,i,j) ((x[0] == a) && (x[1] == b) && (x[2] == c) && (x[3] == d) && (x[4] == f) && (x[5] == g) && (x[6] == h) && (x[7] == i) && (x[8] == j) && (x[9] == k))
  2.  
  3. int main()
  4. {
  5.     int x[10], y;
  6.     for(int i = 0; i < sizeof(x); i++)
  7.         x[i] = i;
  8.     print("Ingrese un numero:\n");
  9.     if(scanf("%d", &y) != 0)
  10.     {
  11.         print("ERROR: No puedes ingresar letras o decimales.\n");
  12.         main();
  13.     }
  14.     else
  15.         printf("El numero que ingresaste fue %d\n", y);
  16.        
  17.     switch(y)
  18.     {
  19.         case 0:
  20.         {
  21.             if(num(0,1,2,3,4,5,6,7,8,9))
  22.             {
  23.             }
  24.         }
  25.         case 1:
  26.         {
  27.             if(num(0,1,2,3,4,5,6,7,8,9))
  28.             {
  29.             }
  30.         }
  31.         case 2:
  32.         {
  33.             if(num(0,1,2,3,4,5,6,7,8,9))
  34.             {
  35.             }
  36.         }
  37.         case 3:
  38.         {
  39.             if(num(0,1,2,3,4,5,6,7,8,9))
  40.             {
  41.             }
  42.         }
  43.         case 4:
  44.         {
  45.             if(num(0,1,2,3,4,5,6,7,8,9))
  46.             {
  47.             }
  48.         }
  49.         default:
  50.         {
  51.             print("ERROR: Solo puedes ingresar por teclado los numeros 0, 1, 2, 3 y el 4.\n");
  52.             main();
  53.         }
  54.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement