Assignment #2 ¡© Character processing

Suppose that character ¡®a¡¯ represents number 0, ¡®b¡¯ represents 1, ¡¦, and ¡®j¡¯ stands for 9. Then number 23 can be represented as ¡°¡±cd¡±. Program a function int StrangeMultiplication(char* m, char* n), which receives two strings m and n in this notation and print out m*n in this notation. For example StrangeMultiplication(¡°bc¡±, ¡°de¡±) prints ¡°eai¡± to the console. The main program will be given at the oral test.

Oral Test: on March 13.

The following program may be useful for this program assignment.

#include <stdio.h>

void main() {
   int      count;
   char     myString[BUFSIZ];
 
   printf(¡±Input a string: ¡°);
   scanf(¡±%s¡±, myString);
  
   count=0;
   while(myString[count]!=¡¯\0¡¯) {
      putchar(myString[count]);
      count=count+1;
   }

   putchar(¡¯\n¡¯);
   printf(¡±length of string: %d\n¡±,count);
}

* 3/9 Modifed : ¡®i¡¯ stands for 9 => ¡®j¡¯ stands for 9, prints ¡°eah¡± => prints ¡°eai¡±

[Download main.c]

[Solution]