1 solutions

  • 0
    @ 2025-12-15 11:58:22

    C++ :

    #include<bits/stdc++.h>
    using namespace std;
    string s;
    int n;
    int main()
    {
    //	freopen("1027.in","r",stdin);
    //	freopen("1027.out","w",stdout);	
    	cin>>s>>n;
    	int len=s.size();
    	int cd=n%len;	
    	string s1=s.substr(len-cd,cd);
    	string s2=s.substr(0,len-cd);
    	cout<<s1<<s2;
    	return 0;
    }
    
    • 1

    Information

    ID
    1063
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By