#include <stdio.h> #include <stdlib.h> int main() { int n; // 分配足够的空间来存储字符串 char str[100000]; // 读取整数 n scanf("%d", &n); // 读取字符串 scanf("%s", str); // 逆序打印字符串的前 n 个字符 for (int i = n - 1; i >= 0; i--) { printf("%c", str[i]); } return 0; }