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

poj真难,老师非让刷

Posted by hostile at 2016-04-04 11:43:48 on Problem 3750
#include<stdio.h>
int main()
{
    char name[70][20];
    int n , w , s , i , j , que[70]={0};
    int cou = 0 , en = 0 , flag = 0;
    scanf("%d",& n );
    for(i=0;i<n;i++)
        scanf("%s", & name[i]);
    scanf("%d,%d",&w , &s );
    for(i=1;i<=n;i++)
        que[i] = i;
    for(i=w;;i++)
    {
        if(que[i]!=0)
            cou++, flag = 1 ;
        if(cou%s == 0&&flag)
        {
            printf("%s\n",name[i-1]);
            que[i]=0, en++;
        }
        i=i%n , flag =0 ;
        if(en==n)
            break;
    }
        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