Advertisement
FoxTuGa

Tele Tec. - <Old>

May 8th, 2011
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.86 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <conio.h>
  4. #include <ctype.h>
  5.  
  6. char seq;
  7. int seqN;
  8. int tecla=1, numX;
  9. int x;
  10. int m;
  11.  
  12. int main()
  13. {
  14.     printf("Sequencia\n");
  15.  
  16.     while( seq != '#' )
  17.     {
  18.         seq = _getch();
  19.  
  20.         seq = toupper( seq );
  21.  
  22.         x = seq - 64;
  23.  
  24.         switch( x )
  25.         {
  26.         case 1:
  27.         case 2:
  28.         case 3: tecla = 2; numX = x; break;
  29.         case 4:
  30.         case 5:
  31.         case 6: tecla = 3; numX = x - 3; break;
  32.         case 7:
  33.         case 8:
  34.         case 9: tecla = 4; numX = x - 6; break;
  35.         case 10:
  36.         case 11:
  37.         case 12: tecla = 5; numX = x - 9; break;
  38.         case 13:
  39.         case 14:
  40.         case 15: tecla = 6; numX = x - 12; break;
  41.         case 16:
  42.         case 17:
  43.         case 18:
  44.         case 19: tecla = 7; numX = x - 15; break;
  45.         case 20:
  46.         case 21:
  47.         case 22: tecla = 8; numX = x - 19; break;
  48.         case 23:
  49.         case 24:
  50.         case 25:
  51.         case 26: tecla = 9; numX = x - 22; break;
  52.         }
  53.     }
  54.     return 0;
  55. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement