输入测试个数;输入要省略的字符所在位置,扫描字符串并逐个字符的输出,当然省略了要被省略的那位
#include<iostream>
#include<string>
using namespace std;
int main()
{
int testNum;
cin >> testNum;
for(int i = 1; i <= testNum; i++)
{
int n;
string s;
cin >> n >> s;
cout << i << " ";
for(int j = 0; j < s.size(); j++)
{
if(j + 1 == n)//要忽略的位置
;
else
{
cout << s[j];
}
}
cout << endl;
}
return 0;
}