Time Limit: 1000MS | Memory Limit: 65536K | |
Total Submissions: 11739 | Accepted: 5403 |
Description
Input
Output
Sample Input
5 Xiaoming Xiaohua Xiaowang Zhangsan Lisi 2,3
Sample Output
Zhangsan Xiaohua Xiaoming Xiaowang Lisi
Source
ACcode:
#include <iostream> using namespace std; int main(){ string name[65]; int loop,p[65]; for(int i=0;i<65;++i)p[i]=i; cin>>loop; int i=0; while(i<loop)cin>>name[i++]; int w,s; char c; cin>>w>>c>>s; w=(w+loop-1)%loop; do{ w=(w+s-1)%loop; cout<<name[p[w]]<<'\12'; for(int i=w;i<loop-1;++i) p[i]=p[i+1]; }while(--loop); return 0; }
版权声明:本文为博主原创文章,未经博主允许不得转载。
原文地址:http://blog.csdn.net/zp___waj/article/details/47721175