Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

0ms,132K短代码

Posted by yuziquan at 2017-06-14 10:09:52 on Problem 3750
#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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator