题解 | #反序输出#

反序输出

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")

空格是不用放在数组里的,所以一行有多少个字符就要多少个空间就好了,如果空间太大,则会把空格给放进去。

全部评论

相关推荐

点赞 评论 收藏
分享
野猪不是猪🐗:我assume that你must技术aspect是solid的,temperament也挺good的,however面试不太serious,generally会feel style上不够sharp
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务