1052: 旋转单词(words)
#include <iostream> #include <iomanip> #include <cstdlib> #include <string> #include <sstream> using namespace std; string num2str(int i) { stringstream ss; ss<<i; return ss.str(); } bool isLower(char s) { return (int)s >= (int)'a' && (int)s <= (int)'z'; } int main(){ int m,n; string s; cin>>m; while(m--) { cin>>s; cin>>n; int t = s.length() - n % s.length(); s = s.substr(t) + s.substr(0,t); cout<<s<<endl; } // cout<<setiosflags(ios::fixed)<<setprecision(4)<<s<<endl; // cout<< setiosflags(ios::fixed)<<setprecision(4) <<c<<endl; }