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

VECTOR轻松AC~

Posted by proverbs at 2012-05-03 12:01:07 on Problem 3750
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <vector>
using namespace std;
struct NOTE
{
	int num;
	char name[70];
};
vector<NOTE> map;
int n,w,s;
void read()
{
	NOTE tmp;
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	{
		tmp.num=i;
		scanf("%s",tmp.name);
		map.push_back(tmp);
	}
	scanf("%d,%d",&w,&s);
}
void numberoff()
{
	int tmp=w-1;
	while(!map.empty())
	{
		tmp=(1+tmp+s-2)%map.size();
		printf("%s\n",map[tmp].name);
		map.erase(map.begin()+tmp);
	}
}
int main()
{
	read();
	numberoff();
	system("pause");
	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