I’ve got something like this. Still get the same runtime error or wrong answer replies all the time though everything works fine on the Code::Blocks IDE. HEre’s the code I wrote:
#include
using namespace std;
int main()
{
int i,a,g;
int *table;
table=new int [5];
i=0;
while(a!=42)
{
cin>>a;
table[i]=a;
table[i++];
}
g=i;
for (i=0;i<=g-2;i++)
{
cout<<endl<<table[i];
}
return(0);
}
Can anybody point to any misakes and/or misunderstanding of the task? Thx!