题解 | 单组_二维字符数组

单组_二维字符数组

https://www.nowcoder.com/practice/2316c1fedff14a8d91694a26c9da3310

#include <algorithm>
#include <iostream>
using namespace std;

int main() {
    int n,m;
    cin>>n>>m;
    string s,union_s = "";
    while (cin>>s) {
        union_s+=s;
    }
    reverse(union_s.begin(), union_s.end());
    int i = 0;
    while (n--) {
        cout<<union_s.substr(i,m)<<endl;
        i+=m;
    }
}
// 64 位输出请用 printf("%lld")

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

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