<mosaic.cnfolio.com>
PROGRAM
  1. /*
  2. decalre veriables
  3. Cipher_amount,
  4. Cipher_cycle = 1,
  5. cipher[],
  6. Phrase_amount,
  7. phrase_cycle,
  8. phrase[]
  9.  
  10. Scanf (“%d,%s,%d,%s”,& cipher_amount ,& cipher[] ,& phrase_amount ,& phrase[]);
  11.  
  12. If (phrase_ammount =>257){
  13.    Print f (“ phrase amount too high, maximum to 256”)
  14. }
  15. If (phrase_cycle =<3){
  16. Print f (“phrase amount is too low, minimum of 4”)
  17. }
  18. Else if (cipher_amount =<1){
  19.    Print f(“cipher value too low, minimum of 2”)
  20. }
  21. Else if (cipher_amount =>17){
  22.    Print f (“cipher amount too high, maximum of 16”)
  23. }
  24.  
  25. For (phrase_cycle = 0; phrase_cycle <Phrase_ammount + 1; phrase_cycle = phrase_cycle + 1) {
  26. If (phrase_cycle == phrase_ammount)
  27. {
  28. Cipher_cycle = cipher_cycle + 1
  29. }
  30. If (cipher [cipher_cycle - 1 ] == phrase[phrase_cycle])
  31. {
  32. Phrase [phrase_cycle] = cipher [cipher_cycle]
  33. Print f(“ phrase[]”);
  34. }
  35. If (cipher_cycle => cipher_amount)
  36. {end}
  37.  
  38.  
  39. */
  40. #include <stdio.h>
  41. int cipher_amount= 0, cipher_cycle=1, phrase_amount= 0, phrase_cycle=0;
  42. char cipher[16];
  43. char phrase[256];
  44. void main (){
  45.  
  46.  
  47.  
  48.  
  49. scanf("%i %s %i %[^\n]%s", &cipher_amount, cipher, &phrase_amount, phrase);
  50. if (phrase_amount >=257){
  51.    printf ("phrase amount too high, maximum to 256\n");
  52. }
  53. if (phrase_amount <=3){
  54.    printf ("phrase amount is too low or number not entered, minimum of 4\n");
  55. }
  56. if (cipher_amount <=1){
  57.    printf("cipher value is too low or number not entered, minimum of 2\n");
  58. }
  59. if (cipher_amount >=17){
  60.    printf ("cipher amount too high, maximum of 16\n");
  61. }
  62.    printf ("%s\n", phrase);
  63.  
  64.  
  65. for (phrase_cycle = 0; phrase_cycle < phrase_amount + 1; phrase_cycle ++)
  66. {
  67. if (phrase_cycle == phrase_amount)
  68. {
  69.    cipher_cycle ++;
  70.    phrase_cycle=0;
  71.    
  72. }
  73. if (cipher [cipher_cycle - 1 ] == phrase[phrase_cycle]){
  74.    phrase [phrase_cycle] = cipher [cipher_cycle];
  75.    printf ("%s\n", phrase);
  76. }
  77.  
  78. }
  79. }