Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
0ms,132K短代码#include<stdio.h> #include<string.h> char a[64][15]; int main(void) { int N, W, S, s; scanf("%d", &N); for (int i = 0; i < N; i++) scanf("%s", &a[i]); scanf("%d,%d", &W, &S); int count = 0, n = N; W -= 2; while (n--) { s = S; while (s--) { do { W = (W + 1) % N; } while (strcmp(a[W], " ") == 0); } printf("%s\n", a[W]); strcpy(a[W], " "); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator