题解 | #反序输出#
反序输出
https://www.nowcoder.com/practice/171278d170c64d998ab342b3b40171bb
#include <iostream>
#include <string>
using namespace std;
char arr[4] ;
int main() {
while (scanf("%s", arr) != EOF) {
for (int i = 3; i >= 0; i--) {
printf("%c", arr[i]);
}
printf("\n");
}
}
// 64 位输出请用 printf("%lld")
空格是不用放在数组里的,所以一行有多少个字符就要多少个空间就好了,如果空间太大,则会把空格给放进去。
查看10道真题和解析

