#46017: 好像可以用雙重for


yp11351280@yphs.tp.edu.tw (710-43韓睿哲)

School : 臺北市私立延平高級中學
ID : 276272
IP address : [203.72.178.1]
Last Login :
2025-06-20 11:39:40
b759. 我明明就有說過= = | From: [203.72.178.1] | Post Date : 2025-05-08 17:46

#include<bits/stdc++.h>
using namespace std;
int main(){
    string s;
    int n=0;
    cin>>s;
    for(int i=0;i<s.size();i++){
        for(int j=i;j<s.size();j++){
            cout<<s[j];
        }
        for(int j=0;j<i;j++){
            cout<<s[j];
        }
        cout<<endl;
    }
}

 
ZeroJudge Forum