#include<string.h>
#include<ctype.h>

char* convert_message(const char *message, char receiver) {
  char *out = strdup(message);
  if (receiver != 'M' && receiver != 'L') return "Mit dir schreib ich nicht!";
  int c = 0;
  for (int i = 0; message[i] != '\0'; i++) {
    if (isalpha(message[i])) {
      if (receiver == 'M') {
        if (c % 2 == 1) out[i] = toupper(message[i]);
        else out[i] = tolower(message[i]);
        }
      else {
        if (c % 2 == 0) out[i] = toupper(message[i]);
        else out[i] = tolower(message[i]);
      }
      c++;
    }
  }
  return out;
}
