fork download
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main(void)
  7. {
  8. int t;
  9. cin >> t;
  10.  
  11. for(int j = 0; j < t; j++)
  12. {
  13. int n;
  14. string arr;
  15. cin >> n >> arr;
  16. cout << j + 1 << " ";
  17. for (int i = 0; i < arr.length(); i++)
  18. {
  19. if (n == i + 1) continue;
  20. cout << arr[i];
  21. }
  22. cout << endl;
  23. }
  24. }
Success #stdin #stdout 0s 5504KB
stdin
4
4 MISSPELL
1 PROGRAMMING
7 CONTEST
3 BALLOON
stdout
1 MISPELL
2 ROGRAMMING
3 CONTES
4 BALOON