题解 | 单组_字符串
单组_字符串
https://www.nowcoder.com/practice/e3a57b2ff6de4aefb82af98925df544e
#include <stdio.h> #include <stdlib.h> int main() { int n; char str[100000];// 分配足够的空间来存储字符串 scanf("%d", &n);// 读取整数 n scanf("%s", str);// 读取字符串 // 逆序打印字符串的前 n 个字符 for (int i = n - 1; i >= 0; i--) { printf("%c", str[i]); } return 0; }
C语言基础 文章被收录于专栏
里面较为详细的介绍了c语言的相关用法和有关题目。