5pts求助,悬赏6关注
  • 板块P8437 伟大的神
  • 楼主lol_qwq
  • 当前回复5
  • 已保存回复5
  • 发布时间2022/11/13 21:28
  • 上次更新2023/10/27 03:02:36
查看原帖
5pts求助,悬赏6关注
768786
lol_qwq楼主2022/11/13 21:28
#include <bits/stdc++.h>
using namespace std;
string a = "";
int main(){
    int x,y,z;
    cin >> x >> y >> z;
    for(int i = 1; i <= y/2;i++){
    a = a.append("lr");
    }
    for(int j = 1; j <= x - y;j++){
    if(z - 1 >= x - y){
        a = a.append("r");
    }
    else{
        if((x - y) % 3 == 0){
            for(int t = 1;t <= (x - y) / 3;t++){
            a = a.append("llr");
            }
            cout << a;
            return 0;
        }
        else{
            if((x - y) % 3 == 1){
            for(int c = 1;c <= (x - y) / 3;c++){
            a = a.append("llr");
            }
            a = a.append("l");
            cout << a;
            return 0;
            }
            if((x - y) % 3 == 2){
            for(int k = 1;k <= (x - y) / 3;k++){
            a = a.append("llr");
            }
            a = a.append("ll");
            cout << a;
            return 0;
            }
        }
        }
    }
    return 0;
}
2022/11/13 21:28
加载中...