#include #include #include #include int main() { char str[21] = "><<><<<><><"; char output[21] = ""; int start = 0; scanf("%s", str); // 文字数をカウント for (;str[start] != '\0';start++); start--; // '\0'の分のカウントを減らす // 入力された文字を最後から見ていく for (int i = 0; start >= 0;i++,start--) { if (str[start] == '>') { output[i] = '<'; } else { output[i] = '>'; } } printf("%s", output); return 0; }