You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
int n;
int m;
int main (){
cin >> n >> m;
int q[n];
int flag = 0;
m = m % n;
for (int i = m ; i < n ; i ++) {
cin >> q[i];
if (i == n - 1 && flag == 0) i = -1 , flag = 1; //读入的时候就进行换位置 直接移到应该到的位置去
if (i == m - 1 && flag == 1) break; //flag 的意思是当读到数组末尾的时候重q[0] 开始读入
}
for (int i = 0 ; i < n ; i ++) {
if (i != 0) cout << " " ;
cout << q[i];
}
cout << endl ;
return 0;
}`
The text was updated successfully, but these errors were encountered:
`#include
using namespace std;
int n;
int m;
int main (){
cin >> n >> m;
int q[n];
int flag = 0;
m = m % n;
}`
The text was updated successfully, but these errors were encountered: