题解 | 数组逆置
数组逆置
https://www.nowcoder.com/practice/b4f598480524493aae4686947fbf31dc
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
int main() {
char str[201];
char str1[201];
scanf("%s", str);
int n = strlen(str);
for (int i = n - 1, j = 0; i >= 0; j++, i--) {
str1[j] = str[i];
}
str1[n] = '\0';
printf("%s\n", str1);
return 0;
}
海康威视公司福利 1409人发布