Advertisement
phayauam

Código claro

Jan 20th, 2013
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.46 KB | None | 0 0
  1.     #include <stdio.h>
  2.     #include <string.h>
  3.      
  4.     enum
  5.     {
  6.         DESPL = 10,
  7.         ASC_ESPACIO = 32,
  8.         ASC_Z = 122
  9.     };
  10.      
  11.     int main(void)
  12.     {
  13.         int i; int c;
  14.         char s[] = "Codigo claro";  
  15.      
  16.         for (i=0; i < strlen(s); i++)
  17.         {
  18.             c = s[i] + DESPL;
  19.             if (c > ASC_Z)
  20.                 c = c - ASC_Z + ASC_ESPACIO;  
  21.             printf("%c", c);
  22.         }
  23.         return 0;
  24.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement