现在的位置: 首页 > 综合 > 正文

sicily 1510

2012年01月05日 ⁄ 综合 ⁄ 共 439字 ⁄ 字号 评论关闭
#include "iostream"
#include "string"
using namespace std;

struct Info
{
	int pos;
	string str;
};

int main()
{
	int N;
	cin >> N;
	Info *s = new Info[N];
	for (int i = 0; i < N; i++)
	{
		cin >> s[i].pos;
		cin >> s[i].str;
	}
	/*for (int i = 0; i < N; i++)
	{
		string::iterator it;
		for (it = s[i].str.begin(); it != s[i].str.end(); it++)
		{
			if ((*it) == s[i].str[s[i].pos-1])
			{
				s[i].str.erase(it);
				break;
			}
		}
	}*/
	for (int i = 0; i < N; i++)
	{
		cout << i+1 << " ";
		for (int j = 0; j < s[i].str.size(); j++)
			if (j != s[i].pos -1)
				cout << s[i].str[j] ;
		cout << endl;
	}
}

 

抱歉!评论已关闭.