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 |
poj真难,老师非让刷#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator