Plz, i'm trying to write a c++ code that erase a specific char. from astring depends on the number of the position that i enter..
here's the problem: http://www.spoj.pl/problems/GNY07A/
and this is all i could write :(and it didn't work !)
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{int N;
int x;
cin>>N;
string s;
for (int i=0;i<N;i++)
{
cin>>x;
cin>>s;
int w=1;
s.erase((x-1),1);
cout<<w++<<" "<<s<<endl;
}
system("PAUSE");
return EXIT_SUCCESS;
}
I just need the new words to appear after i enter the whole of main words,, and not after each word..
Any help??