The code below provides a run-time error showing time limit exceeded. Any help would be appreciated. Thanks :>
#include <iostream>
using namespace std;
int main(void) {
// your code goes here
int n;
while(1)
{
cin>>n;
if(n==42)
{
break;
}
else
{
cout<<n<<endl;
}
}
return 0;
}