<mosaic.cnfolio.com>
PROGRAM
  1. /* START
  2.         input the number of cipher letters
  3.       Display the number of cipher letters
  4.    IF 
  5.        the number of cipher of letters is less than 2
  6.    THEN
  7.         print error message
  8.    ELSE
  9.    IF
  10.        number of cipher letters is less than 17
  11.    THEN
  12.         Print error message
  13.         Initialise order number to equal 1
  14.    WHILE
  15.    
  16.    
  17.    
  18.  
  19. */
  20.  
  21.  
  22. #include <stdio.h>
  23. #include <stdlib.h>
  24. #include <string.h>
  25.  
  26.  
  27.   int main(void)
  28. {
  29.   int i ;
  30.  
  31.   int NumOfLetters ;
  32.   scanf (" %d ", &NumOfLetters);
  33.   printf ("%d\n", NumOfLetters) ;
  34.  
  35.   if ( NumOfLetters < 2) {
  36.      printf(" Error - number must be bigger than 1\n");
  37.      return 0;
  38.      }
  39.      else if ( NumOfLetters > 16 ){
  40.      printf (" Error - number must be less than 17\n");
  41.      return 0;
  42.      }
  43.  
  44.   char CipherChar [16];
  45.   int ordernum =1;
  46.    for(i=0; i<NumOfLetters; i++){
  47.      scanf ( " %c", &CipherChar[i] );
  48.      printf("Step %d ", ordernum++);
  49.      printf ( "sub %c with %c\n", CipherChar[i], CipherChar[(i+1)%NumOfLetters]);
  50.      
  51.    } 
  52.    
  53.      int NumOfLetters2;
  54.   scanf ("%d ", &NumOfLetters2);
  55.   printf ("%d\n", NumOfLetters2) ;
  56.  
  57.   if ( NumOfLetters2 < 0 ) {
  58.      printf(" Error - number must be bigger than 1\n");
  59.      return 0;
  60.      }
  61.      else if ( NumOfLetters2 > 256 ){
  62.      printf (" Error - number must be less than 17\n");
  63.      return 0;
  64.      }}
  65.  
  66.    char Changewords[256] ;
  67.     for (i=0; i<NumOfLetters2; i++);
  68.     { scanf (" %s ", &Changewords );
  69.       printf (" %s", Changewords);
  70.      
  71.   }
  72.   int j;
  73.  
  74.   for(i=0; i<CipherChar; i++){
  75.   for(j=0; j<Changewords; j++){
  76.   if (CipherChar[i] == Changewords[j]);
  77.       Changewords[j] = CipherChar[i+1];
  78.   }
  79.  }  printf ("%s", Changewords);
  80. }