Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #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))
- int main()
- {
- int x[10], y;
- for(int i = 0; i < sizeof(x); i++)
- x[i] = i;
- print("Ingrese un numero:\n");
- if(scanf("%d", &y) != 0)
- {
- print("ERROR: No puedes ingresar letras o decimales.\n");
- main();
- }
- else
- printf("El numero que ingresaste fue %d\n", y);
- switch(y)
- {
- case 0:
- {
- if(num(0,1,2,3,4,5,6,7,8,9))
- {
- }
- }
- case 1:
- {
- if(num(0,1,2,3,4,5,6,7,8,9))
- {
- }
- }
- case 2:
- {
- if(num(0,1,2,3,4,5,6,7,8,9))
- {
- }
- }
- case 3:
- {
- if(num(0,1,2,3,4,5,6,7,8,9))
- {
- }
- }
- case 4:
- {
- if(num(0,1,2,3,4,5,6,7,8,9))
- {
- }
- }
- default:
- {
- print("ERROR: Solo puedes ingresar por teclado los numeros 0, 1, 2, 3 y el 4.\n");
- main();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement